SPQL Function Return Codes

Some SPQL functions generate return codes, allowing 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)].

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 an SPD Server SQL server. 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.