Use the inquire_sql Statement
You can access the Ingres Generic Error Code with the following statement:
inquire_sql errno
To access the error message text, use either of the following statements:
inquire_sql errtext
or
whenever SQLERROR call SQLPRINT
For more information about the inquire_sql statement and the SQLCA, see the Ingres OpenSQL Reference Guide.