rollback is the opposite of the commit function. If you are using a database that supports transactions, rollback is used to revert to the previous data in case of a problem. So, if you begin a transaction and an error occurs in the program, you can set up a call to the rollback function so that any changes that have not yet been committed to the database will go back to their original values.


$return_code = $query_handle->rollback;

The preceding example reverts to the original data; any changes that have been made on the $query_handle handle will be thrown out. If there is a problem with the rollback, an error code will be returned and stored in $return_code.

Perl Database Programming
Perl Database Programming
ISBN: 0764549561
EAN: 2147483647
Year: 2001
Pages: 175

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: