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:
Parameter | Type | Description |
errCode | Longint | Error code |
errText | Text | Error text |
errODBC | Text | ODBC error code |
errSQLServer | Longint | SQL 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.