ODBCRollback

Description:              This statement indicates to a specified ODBC-compliant database that a transaction is to be rolled back (discarded).

Returns:                    Nothing (return values in parameters)

Usage:                       Script

Format:                      ODBCRollback(DB [, ErrorMsg, SQLState, ErrorCode])

Parameters:             DB    { ODBC database }  { required }  { no default }

                                      An ODBC value for the specified ODBC database as returned by ODBCConnect.

                                    ErrorMsg    { text (return value) }  { optional }  { no default }

                                      An optional parameter that will contain the last error message returned by the function.

                                    SQLState   { numeric (return value) }  { optional }  { no default }

                                      An optional parameter that will return the SQL state that the statement was in when the last error occurred.

                                    ErrorCode    { numeric (return value) }  { optional }  { no default }

                                      An optional parameter that is a variable that will contain the native error code for the given driver and an error condition for the last error that occurred.

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); 

]

See Also:

ODBCBeginTrans | ODBCCommit | TODBCBeginTrans | TODBCCommit | TODBCRollback