Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ 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
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 Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm
No new posts what is meaning of the number in dcl Martylin PL/I & Assembler 2 Thu Mar 09, 2017 7:18 am
No new posts SPUFI -- Joining 3 tables – data in... Sysaron DB2 2 Wed Mar 08, 2017 4:18 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us