KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: The new SQL GET LAST ERROR command
PRODUCT: 4D | VERSION: 11.3 | PLATFORM: Mac & Win
Published On: March 18, 2009

4D v11 SQL Release 3 (11.3) has a new command called SQL GET LAST ERROR. It returns the information about the last error generated by an ODBC command.

The syntax is as follows:


SQL GET LAST ERROR (errCode; errText; errODBC; errSQLServer)


Where:

ParameterTypeDescription
errCodeLongintError code
errTextTextError text
errODBCTextODBC error code
errSQLServerLongintSQL server native error code


- 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.