IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Number of rows deleted while deleting data thru Job


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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: 792
Location: Chennai, India

PostPosted: Mon Mar 31, 2008 7:49 pm
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts SCOPE PENDING option -check data DB2 2
Search our Forums:

Back to Top