UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software UniBasic Commands Reference - Rocket Software

rocketsoftware.com
from rocketsoftware.com More from this publisher
11.04.2013 Views

TRANSACTION START Syntax TRANSACTION START {THEN statements [END] | ELSE statements [END]} Description The UniBasic TRANSACTION START command initiates a new transaction, storing all updates until a TRANSACTION COMMIT or TRANSACTION ABORT statement executes. Warning: When you include WRITE statements within a transaction, you must code an ON ERROR clause that takes action to notify the user and take appropriate action, such as stopping the transaction. If the transaction is not aborted by the ON ERROR clause, processing continues, and the transaction could commit inappropriately. Parameters The following table describes each parameter of the syntax. Parameter Description 1-879 UniBasic Commands Reference THEN statements END THEN executes if the TRANSACTION START is successful. END is required to terminate multiline THEN statements. ELSE statements END ELSE executes if the TRANSACTION START is not successful, the record or ID does not exist, or a transaction is already active. END is required to terminate multiline ELSE statements. TRANSACTION START Parameters

STATUS Function Return Values After you execute TRANSACTION START, the STATUS function returns one of the values described in the following table. Example The following program segment displays a message if a transaction is already started when TRANSACTION START is executed: TRANSACTION START ELSE IF STATUS() = 1 THEN DISPLAY "A Transaction had already been started, NESTED Transactions" DISPLAY "are NOT Allowed. (Contact System Administrator)" INPUT PAUSE,1_ END END Related Commands UniBasic Value Description 0 The transaction was started. 1 The transaction was not started. STATUS Function Return Values TRANSACTION COMMIT, TRANSACTION COMMIT TRANSACTION START 1-880

TRANSACTION START<br />

Syntax<br />

TRANSACTION START {THEN statements [END] | ELSE statements [END]}<br />

Description<br />

The <strong>UniBasic</strong> TRANSACTION START command initiates a new transaction,<br />

storing all updates until a TRANSACTION COMMIT or TRANSACTION ABORT<br />

statement executes.<br />

Warning: When you include WRITE statements within a transaction, you must code<br />

an ON ERROR clause that takes action to notify the user and take appropriate action,<br />

such as stopping the transaction. If the transaction is not aborted by the ON ERROR<br />

clause, processing continues, and the transaction could commit inappropriately.<br />

Parameters<br />

The following table describes each parameter of the syntax.<br />

Parameter Description<br />

1-879 <strong>UniBasic</strong> <strong>Commands</strong> <strong>Reference</strong><br />

THEN statements END THEN executes if the TRANSACTION START is successful.<br />

END is required to terminate multiline THEN statements.<br />

ELSE statements END ELSE executes if the TRANSACTION START is not<br />

successful, the record or ID does not exist, or a transaction is<br />

already active. END is required to terminate multiline ELSE<br />

statements.<br />

TRANSACTION START Parameters

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!