Predefined REXX Variables
The SQLEXEC function
and the SQLDBS and SQLDB2 routines set predefined REXX variables as a result of certain
operations.
Predefined REXX variables include:
- RESULT
- Each operation sets this return code. Possible values are:
- n
- Where n is a positive value indicating the number of bytes in a formatted message. The GET ERROR MESSAGE API alone returns this value.
- 0
- The API was executed. The REXX variable SQLCA contains the completion status of the API. If SQLCA.SQLCODE is not zero, SQLMSG contains the text message associated with that value.
- -1
- There is not enough memory available to complete the API. The requested message was not returned.
- -2
- SQLCA.SQLCODE is set to 0. No message was returned.
- -3
- SQLCA.SQLCODE contained an invalid SQLCODE. No message was returned.
- -6
- The SQLCA REXX variable could not be built. This indicates that there was not enough memory available or the REXX variable pool was unavailable for some reason.
- -7
- The SQLMSG REXX variable could not be built. This indicates that there was not enough memory available or the REXX variable pool was unavailable for some reason.
- -8
- The SQLCA.SQLCODE REXX variable could not be fetched from the REXX variable pool.
- -9
- The SQLCA.SQLCODE REXX variable was truncated during the fetch. The maximum length for this variable is 5 bytes.
- -10
- The SQLCA.SQLCODE REXX variable could not be converted from ASCII to a valid long integer.
- -11
- The SQLCA.SQLERRML REXX variable could not be fetched from the REXX variable pool.
- -12
- The SQLCA.SQLERRML REXX variable was truncated during the fetch. The maximum length for this variable is 2 bytes.
- -13
- The SQLCA.SQLERRML REXX variable could not be converted from ASCII to a valid short integer.
- -14
- The SQLCA.SQLERRMC REXX variable could not be fetched from the REXX variable pool.
- -15
- The SQLCA.SQLERRMC REXX variable was truncated during the fetch. The maximum length for this variable is 70 bytes.
- -16
- The REXX variable specified for the error text could not be set.
- -17
- The SQLCA.SQLSTATE REXX variable could not be fetched from the REXX variable pool.
- -18
- The SQLCA.SQLSTATE REXX variable was truncated during the fetch. The maximum length for this variable is 2 bytes.
Note: The values -8 through -18 are returned only by the GET ERROR MESSAGE API. - SQLMSG
- If SQLCA.SQLCODE is not 0, this variable contains the text message associated with the error code.
- SQLISL
- The isolation level. Possible values are:
- RR
- Repeatable read.
- RS
- Read stability.
- CS
- Cursor stability. This is the default.
- UR
- Uncommitted read.
- NC
- No commit. (NC is only supported by some host or System i servers.)
- SQLCA
- The SQLCA structure updated after SQL statements are processed and Db2® APIs are called.
- SQLRODA
- The input/output SQLDA structure for stored procedures invoked using the CALL statement. It is also the output SQLDA structure for stored procedures invoked using the Database Application Remote Interface (DARI) API.
- SQLRIDA
- The input SQLDA structure for stored procedures invoked using the Database Application Remote Interface (DARI) API.
- SQLRDAT
- An SQLCHAR structure for server procedures invoked using the Database Application Remote Interface (DARI) API.