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 > No Dml

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-11-06, 10:33
sunindia sunindia is offline
Registered User
 
Join Date: Oct 2006
Posts: 15
No Dml

UDB 8.2 FP9 , OS WIN


Is there a way to track the no.of updates, insert ,deletes againest a
table?

thanks
Reply With Quote
  #2 (permalink)  
Old 10-11-06, 11:18
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Audit Trail of DML statements

Follow the above thread

Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #3 (permalink)  
Old 10-12-06, 05:23
rahul_s80 rahul_s80 is offline
Registered User
 
Join Date: Jul 2006
Location: Pune , India
Posts: 433
if u just want to get count of rows affected u can use :
GET DIAGNOSTICS Statement

The GET DIAGNOSTICS statement returns information about the most recently run SQL
statement. One can either get the number of rows processed (i.e. inserted, updated, or deleted),
or the return status (for an external procedure call).

In the example below, some number of rows are updated in the STAFF table. Then the count
of rows updated is obtained, and used to update a row in the STAFF table:

BEGIN ATOMIC
DECLARE numrows INT DEFAULT 0;
UPDATE staff
SET salary = 12345
WHERE ID < 100;
GET DIAGNOSTICS numrows = ROW_COUNT;
UPDATE staff
SET salary = numrows
WHERE ID = 10;
END
Reply With Quote
  #4 (permalink)  
Old 10-18-06, 13:56
sunindia sunindia is offline
Registered User
 
Join Date: Oct 2006
Posts: 15
thanks Rahul.
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