8. SQL Statements : COMMIT : COMMIT Example
 
Share this page                  
COMMIT Example
The following embedded example issues two updates, each in its own transaction:
EXEC SQL CONNECT 'personnel';

EXEC SQL UPDATE employee
SET SALARY = salary * 1.1
WHERE rating = 'Good';

EXEC SQL COMMIT;
EXEC SQL UPDATE employee
SET SALARY = salary * 0.9
WHERE rating = 'Bad';

EXEC SQL DISCONNECT;
/* Implicit commit issued on disconnect */