sqlcommit() — Commit the Database Transaction
Commits the current database transaction. This function supports the EXEC SQL COMMIT WORK statement to commit any database transaction that is active since the most recent:
This function returns normalized values. For more information, see the function return values in the "General Diagnostics" section in this chapter:
NOTES
EXAMPLE
- When using the ESQL-LIB interface, there is always a database transaction active.
- Work done while a database is connected is not committed when you call
sqldiscon()
. You must commit work using the COMMIT WORK statement or a call tosqlcommit()
before you disconnect the database, or before exiting from your program. Otherwise, the disconnection does not occur and your open transaction is rolled back. Databases do not disconnect until a transaction ends. Therefore, any disconnections pend until the application encounters a COMMIT WORK or ROLLBACK WORK statement or ansqllogout()
call (which automatically rolls back all work). If the transaction does not complete and you reconnect the database, the disconnect never actually occurs.This example determines from a flag (
dynpending
) that there is uncommitted work prior to an attempt to exit the application through aswitch
statement. It queries the user and commits the work as directed:
SEE ALSO
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |