1,900 pts.
 Delete query in Embedded SQL
I have a delete query in embedded SQL. How can I know how many records are deleted?

Software/Hardware used:
ASKED: May 30, 2012  5:18 AM
UPDATED: June 13, 2012  2:23 PM
  Help
 Approved Answer - Chosen by RamvishakRamesh (Question Asker)

C Name
COBOL Name  ILE RPG Name
PL/I Name   RPG/400 Name  Field Value

SQLERRD(3)  SQLERRD(3)    For a CONNECT for status statement, SQLERRD(3) contains
sqlerrd[2]  SQLER3        information about the connection status. See “CONNECT (Type 2)”
                          on page 647 for more information.
                          For INSERT, UPDATE, REFRESH, and DELETE, shows the number
                          of rows affected.
                          For a FETCH statement, SQLERRD(3) contains the number of rows
                          fetched.
                          For the PREPARE statement, contains the estimated number of rows
                          selected. If the number of rows is greater than 2 147 483 647, then 2
                          147 483 647 is returned.
ANSWERED:  May 30, 2012  3:03 PM (GMT)  by RamvishakRamesh

 
Other Answers:

Use c+ GET DIAGNOSTICS :delrowcnt = ROW_COUNT after delete statement that should give number of deleted records

Last Wiki Answer Submitted:  November 28, 2012  5:07 am  by  Eyespi   45 pts.
Latest Answer Wiki Contributors:  rajsubhyd   105 pts. , Eyespi   45 pts.
To see other answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

The field SQLER3 will contain the number of rows affected. This field is part of the SQLDA data structure populated for each SQL statement executed. In RPG(LE) programs, this data structure is automatically available to you.

 7,185 pts.

 

This field is part of the SQLDA data structure…

Minor typo? But the student/interviewee can track down the appropriate data structure from the information given.

Tom

 107,995 pts.

 

SQLERRD(3) is a part of SQLCA

 1,900 pts.