Function DbRRollback() Foundation

Executes a roll back operation on the current table row.

Syntax
DbRRollback() --> NIL
Return

The return value is always NIL.

Description

When data is assigned to field variables, the DbCommit() function must be called to store the new data permanently in a database table. If this commit operation fails, the original data of the current table row can be restored by calling DbRRollback(). All changes made to the current table row are then discarded.

Examples
// This example demonstrates a typical usage scenario 
// for the DbRRollback() function. It is called in the 
// error recovery section of BEGIN/END SEQUENCE and 
// handles runtime errors that may occur when REPLACE 
// or DbCommit() is executed. 

LOCAL oErr, bErr 
LOCAL nNumber := 12345 

<open a database> 

bErr := Errorblock( {|o| Break(o) } ) 
BEGIN SEQUENCE 
   REPLACE FIELD->TINYINT WITH nNumber 
   DbCommit() 
   ErrorBlock( bErr ) 

RECOVER USING oErr 
   ErrorBlock( bErr ) 
   Alert( "Error: " + oErr:description ) 
   DbRRollback() 
ENDSEQUENCE 
ErrorBlock( bErr ) 

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.