View previous topic :: View next topic |
Author |
Message |
subho Beginner
Joined: 19 Oct 2004 Posts: 13 Topics: 4 Location: Atlanta
|
Posted: Fri Jun 09, 2006 1:40 pm Post subject: Delete and Count in DB2 |
|
|
I have a COBOL with embedded SQL for DB2 program. I want to get the number of rows which are deleted from the DB2 table. I can do it in two steps easily. At first, count how many records will be deleted from the table. And then delete all of them. But is there any single SQL or any DB2 parameter, which will let me know how many rows I have just deleted?
Thanks,
Subho |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Fri Jun 09, 2006 3:05 pm Post subject: |
|
|
subho,
After the succesful execuetion of the sql Check for SQLERRD(3) from SQLCA. It will contain the no: of the rows deleted/updated.
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
schintala Beginner
Joined: 18 May 2005 Posts: 108 Topics: 31 Location: USA
|
Posted: Fri Jun 09, 2006 3:16 pm Post subject: |
|
|
I think you can see the count one of the SQLCA variables. I guess it would be SQLERRD(3). Try displaying this variable after executing the delete statement in your application program. |
|
Back to top |
|
|
|
|