105 pts.
 Embedded SQL in RPGILE
For a SELECT Query in RPG program if we get -811 SQL error, it means we have got multiple selections in our query. Is it possible to know how many records are selected from the SELECT statement from any field of SQLCA or in some other way?

Software/Hardware used:
I series
ASKED: September 16, 2010  5:40 PM
UPDATED: September 16, 2010  11:00 PM

Answer Wiki:
From the V5R4 SQL Reference:<ul> <li>For a CONNECT for status statement, SQLERRD(3) contains information on the connection status. See “CONNECT (Type 2)” on page 557 for more information.</li><li>For INSERT, UPDATE, REFRESH, and DELETE, shows the number of rows affected.</li><li>For a FETCH statement, SQLERRD(3) contains the number of rows fetched.</li><li>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.</li> </ul> The SQLCA (Communications Area) should define SQLERRD(3) in RPGIV and SQLER3 in RPGIII. (The SQL Reference and SQL Embedded Programming manuals describe usage for all languages.) It's hard to tell from what you asked if any part of that helps. Tom
Last Wiki Answer Submitted:  September 16, 2010  11:00 pm  by  TomLiotta   110,135 pts.
All Answer Wiki Contributors:  TomLiotta   110,135 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


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