IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Forcing Timestamp during Insert/Update


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
HameedAli

Active User


Joined: 16 Apr 2009
Posts: 151
Location: India

PostPosted: Tue Jun 14, 2011 9:28 pm
Reply with quote

Hi
How to force the create/update timestamp to current timestamp during insert/update from one table to another?
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Jun 14, 2011 9:30 pm
Reply with quote

UPDATED_TIMESTAMP = current timestamp
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Tue Jun 14, 2011 11:14 pm
Reply with quote

Hi HameedAli,

That column should be created as ROW CHANGE TIMESTAMP, it should take care of the things.

For more information please look into DB2 V9 SQL Reference ( Chapter 5 --> Create Table --> Example 9)

Thanks,
sushanth
Back to top
View user's profile Send private message
HameedAli

Active User


Joined: 16 Apr 2009
Posts: 151
Location: India

PostPosted: Thu Jun 16, 2011 11:23 am
Reply with quote

Thanks sushanth, this is what I was looking for.
Thanks for your time Craq, I was looking for something like row change timestamp.

Is there any other possible ways to update the timestamp other than these 3 ways?
1) Create TIMESTMAP column as row change timestamp
2) Create a trigger to update timestamp
3) Update timestamp manually.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Insert header record with record coun... DFSORT/ICETOOL 14
No new posts Insert system time/date (timestamp) u... DFSORT/ICETOOL 5
No new posts Identify Program Insert DB2 7
No new posts Timestamp difference and its average ... DB2 11
Search our Forums:

Back to Top