db_finish_transaction()

Terminates a nested transaction call.

Syntax

db_finish_transaction(
   commit INTEGER )
  RETURNING result INTEGER
  1. commit is a boolean that indicates whether the transaction must be committed.
  2. result is the SQL execution status or the commit or rollback. Zero indicates success.

Usage

This function encapsulates the COMMIT WORK or ROLLBACK WORK instructions to end a transaction.

When the number of calls to DB_START_TRANSACTION() matches, this function executes a COMMIT WORK if the passed parameter is TRUE; if the passed parameter is FALSE, it executes a ROLLBACK WORK.

If the number of start/finish calls does not match, the function does nothing.