473,394 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

timestamp purpose and use if it

Hi there,

I'm using a creationDate and ModifiedDate in all my tables with
Datatype: DateTime.
In most of my tables I need to do update/delete.

Do I also need to add a field with data type timestamp in my CRUD
tables ?
Why do I need timestamp field ?
how to use it I mean is it just define the timestamp field in those
tables? how does that work then?

thanks mesut
Sep 19 '08 #1
3 1330
The timestamp data type has special rules: you can't update it
yourself, and it always gets updated with any row update. As such, it
is a very quick way of testing a row for changes, since it is
impossible to update the row without updating the timestamp. In
reality, it is just a database-wide counter... every row update
increments the counter etc.

You don't *need* a timestamp, but it can be very useful in a lot of
scenarios. Many ORM tools will recognise timestamps and make
appropriate concurrency checks (rather than checking every column for
updates).

Marc
Sep 19 '08 #2
On Sep 19, 3:31*pm, Marc Gravell <marc.grav...@gmail.comwrote:
The timestamp data type has special rules: you can't update it
yourself, and it always gets updated with any row update. As such, it
is a very quick way of testing a row for changes, since it is
impossible to update the row without updating the timestamp. In
reality, it is just a database-wide counter... every row update
increments the counter etc.

You don't *need* a timestamp, but it can be very useful in a lot of
scenarios. Many ORM tools will recognise timestamps and make
appropriate concurrency checks (rather than checking every column for
updates).

Marc
Hi Marc,

thanks for the info.. So if I understand well it's useful for the
concurrency checking. Any simple sample you can provide? at least can
you give the keywords to google?

thanks again,
mesut

Sep 19 '08 #3
optimistic concurrency timestamp
http://www.google.com/search?q=optim...ency+timestamp
Sep 19 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: rong.guo | last post by:
Hello Group, I am having a really weird problem... Can anyone tell the difference between Query 1 and Query 2 below? Why Query 2 excludes '2/28/2005'? Many thanks! create table a...
7
by: laurenq uantrell | last post by:
Is there any reason to have a row that is the PK/Identity and a row that is datatype Timestamp in the same table? Does this in any way help speeding up row updates? Thanks, lq
2
by: Russell Smith | last post by:
Timestamps support infinity. However if appears dates do not. When timestamps are cast to dates, there is no output. Is this an acceptable option or not? Below are a number of examples...
5
by: pankaj_wolfhunter | last post by:
Greetings, In Sybase, a timestamp column is automatically loaded by the DB engine and its in some hex format. This is shown below id timestamp_value ----------- ------------------ 1...
7
by: JJ | last post by:
How do I set one field to have the updated timestamp, and another to have the created timestamp? I want to do this directly from code generated from DB Designer if possible?! JJ
5
by: Sumanth | last post by:
Hi, Information with regard to creation of a table is stored in SYSTABLES. Is modified time stamp of a table stored in DB2, if so where. Thanks, Sumanth
6
by: marc | last post by:
hi im trying to convert Date() into a unix timestamp so i can stick the result into a mysql db, please help!
67
by: James Harris | last post by:
I have a requirement to store timestamps in a database. Simple enough you might think but finding a suitably general format is not easy. The specifics are 1) subsecond resolution - milliseconds...
0
by: nichele | last post by:
Hi all, for troubleshooting purpose, I would like to add to all my tables (and for all records) the creation and modification timestamp fields. Do you know if this is a common practice ? Do you...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.