If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Selecting the last commited values

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-16-12, 18:22
sunilsps82 sunilsps82 is offline
Registered User
 
Join Date: Jan 2012
Posts: 3
Selecting the last commited values

Hi,

How can I select the last commited value from a table? I have updated this value multiple times but would like to read the last commited value. I can not store the last commited value in a variable as the multiple procedures and packages are updating and selecting from this table and I cannot pass on this value as parameter. Also is there a way using which i can capture the total number of inserts that got commited when commit was executed.
Reply With Quote
  #2 (permalink)  
Old 01-17-12, 01:24
amitrai4 amitrai4 is offline
Registered User
 
Join Date: Aug 2011
Posts: 46
In SP you can get affected rows by,

GET DIAGNOSTICS <#rowcount> = ROW_COUNT;

on CLP something like this.

db2 -m "insert into hello values(1)"
Number of rows affected : 1
DB20000I The SQL command completed successfully.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On