Large Object Locator errors
All Large Object Locator functions
use the return value to indicate failure. Functions that return a
pointer return NULL
in the event of failure. Functions
that return an integer return -1
.
Large Object Locator functions also provide an error code argument that you can test for specific errors. You can pass this error code to lld_error_raise()—which calls mi_db_error_raise if necessary to generate an MI_EXCEPTION—and propagate the error up the calling chain.
For ESQL/C functions, the LLD_E_SQL error indicates that an SQL error occurred. You can check the SQLSTATE variable to determine the nature of the error.
When an error occurs, Large Object Locator functions attempt to reclaim any outstanding resources. You should close any open large objects and delete any objects you have created that have not been inserted into a table.
A user-defined routine that directly or indirectly calls a Large Object Locator function (API version) can register a callback function. If this function catches and handles an exception and returns control to the Large Object Locator function, Large Object Locator returns the LLD_E_EXCEPTION error. You can handle this error as you would any other: close open objects and delete objects not inserted in a table.