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

How to get the details of rhte rows updated in the table


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

New User


Joined: 11 Aug 2005
Posts: 4

PostPosted: Mon Mar 12, 2007 6:06 pm
Reply with quote

Hi,

Can anyone pls tell me how to get the details of the updated rows of the table being used either by the SQL query/the Cobol-Db2 program.

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

Active User


Joined: 26 May 2005
Posts: 178
Location: Copenhagen, Denmark

PostPosted: Mon Mar 12, 2007 6:17 pm
Reply with quote

You could find that, if you have any Updated timestamp punched into one of the columns of the tabel and the program is updating that column too when it updates the data.

If you dont have that then it would be difficult i would say. If your program has done some thing which it was not intended to do, then you can RECOVER using the image copies (if one was taken earlier).
I'm not sure whether this can be determined on LOGS.
If some traces were set to ON, then some experts could figure out this i guess.
Back to top
View user's profile Send private message
veselvar

New User


Joined: 11 Aug 2005
Posts: 4

PostPosted: Mon Mar 12, 2007 6:22 pm
Reply with quote

Hi,

Thanks for ur note.

Can we get the details from the Sysibm.syscatalog thru the syscolumns_hist ?
Back to top
View user's profile Send private message
vini_srcna

Active User


Joined: 26 May 2005
Posts: 178
Location: Copenhagen, Denmark

PostPosted: Mon Mar 12, 2007 7:27 pm
Reply with quote

No you cannot. That's a separate concept.
It does not have anything you need at this scenario.
Back to top
View user's profile Send private message
Prajesh_v_p

Active User


Joined: 24 May 2006
Posts: 133
Location: India

PostPosted: Wed Mar 14, 2007 6:54 pm
Reply with quote

If you are using a COBOL - DB2 program:
I read from a document that you can see the variable SQLERR(3) for the number of rows updated, inserted or deleted by a DB2 query from SQLCA( SQL communications area).

Anyway I did nt check it out. Give it a shot icon_smile.gif
Back to top
View user's profile Send private message
Prajesh_v_p

Active User


Joined: 24 May 2006
Posts: 133
Location: India

PostPosted: Wed Mar 14, 2007 7:14 pm
Reply with quote

Please find more details at publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.db2.doc.sqlref/bjnrsqlc999499.htm
Back to top
View user's profile Send private message
vini_srcna

Active User


Joined: 26 May 2005
Posts: 178
Location: Copenhagen, Denmark

PostPosted: Wed Mar 14, 2007 9:06 pm
Reply with quote

That is valid only for embedded sql statements and SQLERR(3) could give value for only the previously executed embedded sql statement.
Say you have run the program and the program has updated/inserted/deleted few rows. Then i wonder how one could find that with out the controls in place.
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 Load new table with Old unload - DB2 DB2 6
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Check data with Exception Table DB2 0
Search our Forums:

Back to Top