COMMIT
COMMIT is useful for multiple inserts, updates, or deletes in SQL paragraphs. A database commit releases the locks on inserted, updated, or deleted records. If used in an active SELECT paragraph, unpredictable results may occur.
When the application completes, COMMIT is performed automatically unless ROLLBACK was done or, for callable Production Reporting, the -XC flag was set.
Other commands or options, such as CONNECT and the use of DDL statements for some databases with a BEGIN-SQL paragraph, can also cause the database to do a commit.
COMMIT is an Production Reporting command and should not be used within an SQL paragraph. If used in an SQL paragraph, unpredictable errors can occur.
COMMIT can be used with DB2, ODBC, DDO, Teradata, and Oracle. For Sybase, use BEGIN TRANSACTION and COMMIT TRANSACTION within SQL paragraphs as in the following code segment.
... ! Begin Transaction occurred previously begin-sql insert into custlog values (&cust_num, &update_date) end-sql add 1 to #inserts if #inserts >= 50 begin-sql commit transaction;! Commit every 50 rows begin transaction ! Begin next transaction end-sql move 0 to #inserts end-if
... ! One more Commit Transaction is needed