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
 
row change timestamp

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
charanmsrit

New User


Joined: 25 Oct 2007
Posts: 82
Location: Australia

PostPosted: Tue Jul 10, 2018 12:30 pm    Post subject: row change timestamp
Reply with quote

I have a need to capture the timestamp when any of the row columns actual changed the last time. I tried defining a table with a timestamp column definition

Code:
GENERATED BY DEFAULT FOR EACH ROW ON UPDATE AS ROW CHANGE TIMESTAMP


What I found is that the timestamp column is updated every time an UPDATE statement is executed on the row even when there is no changes to any of the column values. Is there a way to define this column so that DB2 updates the timestamp only when the row changes?

p.s: Understand that there are other ways such as TEMPORAL, Triggers etc for capturing audit but due to the application complexity and time restriction, this would be ideal.

Thanks
Charan
Back to top
View user's profile Send private message

Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1942
Location: NY,USA

PostPosted: Tue Jul 10, 2018 5:00 pm    Post subject:
Reply with quote

Do you think it’s worth for IBM Developers to now magical identity and compare host values vs DB values for every column and then do change the time stamp? If so then wait till that rolled out.

However, what is that you want to achieve out of it, what’s the end goal? Plus any data modeler will recommend to have time stamp column from day 1 when the table is designed for any inserts/update and programmers use them. Now few places when you can smartly not update when no value change detected program coding but one can skip that and just blunt update.
Back to top
View user's profile Send private message
charanmsrit

New User


Joined: 25 Oct 2007
Posts: 82
Location: Australia

PostPosted: Tue Jul 10, 2018 6:25 pm    Post subject:
Reply with quote

rohit, with all due respect I find your response a bit over board. It may be a silly question but I don’t think it deserves such a response with full of attitude, seriously?? I couldn’t find from IBM manuals if there was a way to define a row change time stamp column that actually identify a change in the row data . Thought I may have missed something and decided to throw the question in the forum for help. Anyways have now found from IBM manuals to use search condition on UPDATE statement to bypass the time stamp update when there is no change to any columns.
Thanks for your response by the way.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1942
Location: NY,USA

PostPosted: Wed Jul 11, 2018 3:12 am    Post subject:
Reply with quote

charanmsrit, I don't want to respond to your arguments or observation since that's not why we here for, are we?
Quote:
IBM manuals to use search condition on UPDATE statement to bypass the time stamp update when there is no change to any columns.

If you get time , explain further to what is this approach ? Are you now changing the application program for this? I thought you don't wanted to.
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 Cannot change DATACLAS on DFSMSdss re... Alan Playford JCL & VSAM 11 Tue May 01, 2018 6:43 pm
No new posts Repeat Sequence Number Until change i... rahulabvp DFSORT/ICETOOL 6 Thu Mar 29, 2018 12:51 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 How to change the logon screen info o... sakthikumarT TSO/ISPF 4 Fri Dec 29, 2017 6:44 pm
No new posts Change NULL indicator in UNLOAD utility Khadhar Basha DB2 2 Fri Dec 15, 2017 3:01 pm

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