View previous topic :: View next topic
|
Author |
Message |
rahulcherekar
New User
Joined: 20 Feb 2007 Posts: 16 Location: New York
|
|
|
|
Hi,
I have an account file. I need to delete rows corresponding to each account read from the 2 diff tables.
Steps performed in COBOL-DB2 program are:
step 1: read account file
step 2: perform delete until end of file
step 2a: delete rows for accountn from table1
step 2b: delete rows for accountn from table2
step 2c: read account file
Now, I want to display total count for number of records deleted.
One solution, is to perform select count(*) followed by delete for table1 and table2 respectively. Doing so I have to make 4 db2 calls for each account.
I remember spufing the delete query gives the count. Is there any variable which stores this count, which I can use to get the total count?
Thanks,
Rahul. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
SQLERRD(3) will have the number of rows deleted after each DELETE is executed. |
|
Back to top |
|
|
Ketan Varhade
Active User
Joined: 29 Jun 2009 Posts: 197 Location: Mumbai
|
|
|
|
Get dignostic will also work |
|
Back to top |
|
|
|