ODBCRollback
(Engine-Level Function)
Description: | Indicates to a specified ODBC-compliant database that a transaction is to be rolled back (discarded). |
Returns: | Nothing (return values in parameters) |
Usage: | Script Only. |
Function Groups: | Database and Data Source, ODBC |
Related to: | ODBCBeginTrans | ODBCCommit | TODBCBeginTrans | TODBCCommit | TODBCRollback |
Format: | ODBCRollback(DB [, ErrorMsg, SQLState, ErrorCode]) |
Parameters: |
DB |
Required. An ODBC value for the specified ODBC database as returned by ODBCConnect. |
ErrorMsg |
A descriptive error or status message, returned by the function. If valid, both ErrorMsg and SQLState will be valid. |
SQLState |
A 5-character SQL State code. SQL State codes are defined by Microsoft and by the vendor of each ODBC driver. |
ErrorCode |
An unsuccessful operation always returns a non-zero value, which is a numeric error code specific to the DBMS vendor's ODBC driver or Microsoft's ODBC Driver Manager. A successful operation will always return a 0. ErrorMsg and SQLState may or may not be set valid in the event of a successful connection. If set valid, they should be examined for relevant status information. |
Comments: | Discards a transaction defined as all the SQL statements executed on an ODBC-compliant database since the transaction began. If any error, no matter how minor, occurs as a result of the statement, and the TODBCConnect or ODBCConnect that connected to the database had its Disconnect parameter set to true, the value of DB will become invalid (i.e. the connection to the database will be dropped). |
Example:
[ ODBCBeginTrans(DB); ODBC(DB, "DELETE * FROM TEST"); ODBC(DB, "INSERT INTO TEST VALUES('KeyString', 'Value')"); ODBCRollback(DB); ]