View previous topic :: View next topic
|
Author |
Message |
Madhan Mohan Pendyala
New User
Joined: 18 Mar 2008 Posts: 6 Location: Hyderabad
|
|
|
|
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 |
|
|
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
|
|
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 |
|
|
Madhan Mohan Pendyala
New User
Joined: 18 Mar 2008 Posts: 6 Location: Hyderabad
|
|
|
|
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 |
|
|
the_gautam
Active User
Joined: 05 Jun 2005 Posts: 165 Location: Bangalore
|
|
|
|
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 |
|
|
|