Skip to main content
Version: Next

SQL GET LAST ERROR

SQL GET LAST ERROR ( errCode : Integer ; errText : Text ; errODBC : Text ; errSQLServer : Integer )

ParameterTypeDescription
errCodeInteger←Error code
errTextText←Error text
errODBCText←ODBC error code
errSQLServerInteger←SQL server native error code
History
ReleaseChanges
2004Created

Description​

The SQL GET LAST ERROR command returns information related to the last error encountered during the execution of an ODBC command. The error may come from the 4D application, the network, the ODBC source, etc.

This command must generally be called in the context of an error-handling method installed using the ON ERR CALL command.

  • The errCode parameter returns the error code.
  • The errText parameter returns the error text.

The last two parameters are only filled when the error comes from the ODBC source; otherwise, they are returned empty.

  • The errODBC parameter returns the ODBC error code (SQL state).
  • The errSQLServer parameter returns the SQL server native error code.

See also​

Last errors
ON ERR CALL

Properties​

Command number825
Thread safeno