Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Need Guidance regarding UPDATE query Poha Eater DB2 3 Mon Feb 12, 2018 11:35 pm
This topic is locked: you cannot edit posts or make replies. UTC Timestamp Log Thangavel COBOL Programming 5 Mon Jan 22, 2018 9:04 pm
No new posts Conversion of DLI update Jobs as BMP ... Gopinath Shanmugam IMS DB/DC 3 Wed Dec 20, 2017 12:02 pm
No new posts Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts How to insert a value on specific pos... Poha Eater DFSORT/ICETOOL 9 Sun Oct 01, 2017 3:04 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us