MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Delete and Count in DB2

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
subho
Beginner


Joined: 19 Oct 2004
Posts: 13
Topics: 4
Location: Atlanta

PostPosted: Fri Jun 09, 2006 1:40 pm    Post subject: Delete and Count in DB2 Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Fri Jun 09, 2006 3:05 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
schintala
Beginner


Joined: 18 May 2005
Posts: 108
Topics: 31
Location: USA

PostPosted: Fri Jun 09, 2006 3:16 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group