Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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
View previous topic :: :: View next topic  
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

Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 788
Location: Chennai, 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: 165
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Data security erase on RAID device steve-myers All Other Mainframe Topics 0 Sat Jan 13, 2018 6:41 am
No new posts Append the milliseconds to the data s... girishb2 DFSORT/ICETOOL 1 Thu Dec 21, 2017 9:07 pm
No new posts Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm
No new posts TBSARG - Deleting the search criteria... ISPFHerc TSO/ISPF 6 Thu Dec 14, 2017 8:18 am
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us