SPQL Function Return Codes

Some SPQL functions generate return codes, enabling you to check the value and take appropriate action in your application code. Typically, the application action taken upon receiving an error code is a call to SPQLGMSG() to get the contents of the diagnostic buffer. The program can then display the buffer's contents to the user or write the contents to a log. The return codes in this section are classified by their state: positive [(WARNING), (SUCCESS)] or negative [(ERROR)].

List of SPQL Function Return Codes

The following table contains the function return code and a description.
Function Return Code
Description
SPQL_SUCCESS(==0)
Successful completion of the SPQL function call.
SPQL_ENDDATA (WARNING)
All rows selected were read from the statement token.
SPQL_INITFAILED (ERROR)
Initialization failure. (It is unsafe for your application to make additional SPQL calls if this error occurs.)
SPQL_NOMEM
Unable to allocate memory for some type of SPQL data structure. Check the diagnostic buffer for details.
SPQL_CONFAILED (ERROR)
Unable to make a connection to the server’s SQL processor. Check the diagnostic buffer for details.
SPQL_BADSTMT (ERROR)
SQL statement is incorrectly formatted for submission to sqlprepare(). Either the statement is blank (all white space) or contains contiguous non-white space characters.
Last updated: February 8, 2017