ODBCStatus

(Engine-Level Function)

Description: Returns the requested information about the last ODBC statement to execute.
Returns: Varies - see comments
Usage: Script Only.
Function Groups: Database and Data Source,  ODBC
Related to: ODBC | ODBCConfigureData | ODBCConnect | ODBCDisconnect | ODBCSources | ODBCTables | TODBC | TODBCConnect | TODBCDisconnect
Format: ODBCStatus(Option[, ODBCHandle])
Parameters:  
Option
Required. Any numeric expression for the option to indicate what information is desired about the last ODBC statement executed as follows:

Option

Information desired

0

Return 0 if information or 1 if error

1

SQL state text

2

Native error code

3

ODBC error text

4

Error text length

ODBCHandle
Optional ODBC Handle value, as returned from ODBCConnect or TODBCConnect, for which you want a status report.
Omitting the ODBCHandle parameter returns a status report for the last ODBC operation that was executed. As ODBC operations can be concurrently executed, there is no guarantee that this is the operation for which you intend to obtain status, unless you explicitly provide an ODBC handle value
Comments: The return value for this function may be a single value, an array of values (if more than one error was generated), or invalid (if the last ODBC operation did not generate any status information).
This function may be used with threaded ODBC calls, however, if multiple ODBC calls are executing simultaneously, there is no indication as to which one generated the message.