Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Forcing Timestamp during Insert/Update

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Forcing Timestamp during Insert/Update
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    Post subject:
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: 1013
Location: India

PostPosted: Tue Jun 14, 2011 11:14 pm    Post subject:
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    Post subject: Reply to: Forcing Timestamp during Insert/Update
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am
No new posts Insert Lines in JCL with Rexx after a... Willy Jensen CLIST & REXX 3 Tue Aug 30, 2016 4:18 pm
No new posts How to insert a lengthy string havin... vidyaa DB2 7 Thu Aug 25, 2016 5:20 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us