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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Conditional highlighting of rows in I... packerm CLIST & REXX 2 Thu Sep 21, 2017 6:50 pm

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