Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Number of rows deleted while deleting data thru Job

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
Author Message
Madhan Mohan Pendyala

New User


Joined: 18 Mar 2008
Posts: 6
Location: Hyderabad

PostPosted: Mon Mar 31, 2008 7:34 pm    Post subject: Number of rows deleted while deleting data thru Job
Reply with quote

when deleting data in the table through job, which statement in the job should be specified which gives the number of rows deleted.
Back to top
View user's profile Send private message
References
Gnanas N

Senior Member


Joined: 06 Sep 2007
Posts: 473
Location: India

PostPosted: Mon Mar 31, 2008 7:49 pm    Post subject:
Reply with quote

Displaying number of rows updated.
You can display the number of rows affected by an SQL Insert, Update or Delete by displaying the value of SQLERRD(3).

Code:
EXEC SQL

 INSERT ......

END-EXEC.

Code:
DISPLAY SQLERRD(3)  ' ROWS WERE INSERTED '.


Code:
EXEC SQL

 DELETE .......

END-EXEC.

Code:
DISPLAY ' NUMBER OF ROWS DELETED: '  SQLERRD(3).
Back to top
View user's profile Send private message
Madhan Mohan Pendyala

New User


Joined: 18 Mar 2008
Posts: 6
Location: Hyderabad

PostPosted: Mon Mar 31, 2008 7:57 pm    Post subject: Reply to: Number of rows deleted while deleting data thru Jo
Reply with quote

Hey, Thanks for the Info.
When we execute SPUFI, SQLERRD(3) will have the number of rows effected. In this case, I'm deleting the data thru job. How can we use this SQLCA variable here?
Back to top
View user's profile Send private message
the_gautam

Active User


Joined: 05 Jun 2005
Posts: 167
Location: Bangalore

PostPosted: Mon Mar 31, 2008 10:18 pm    Post subject:
Reply with quote

To get the number of rows affected by a query in the COBOL program, we may use SQLERRD(3) as mentioned by gnanas.

the other method is

EXEC SQL
GET DIAGNOSTICS :rcount
END-EXEC
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1