SQLCOMMIT( ) Function Example

The following example assumes SQLCONNECT( ) is successfully issued, and its return value is stored to a memory variable named gnConnHandle. SQLSETPROP( ) is used to set the Transactions property to 2 (Manual), allowing you to use SQLCOMMIT( ) and SQLROLLBACK( ).

The authors table is modified with SQLEXEC( ), and the changes to the table are committed with SQLCOMMIT( ).

= SQLSETPROP(gnConnHandle, 'Transactions', 2)  && Manual transactions
= SQLEXEC(gnConnHandle, "INSERT INTO authors (au_id, au_lname);
   VALUES ('aupoe', 'Poe')")  && Modify the authors table
= SQLCOMMIT(gnConnHandle)  && Commit the changes