cfunc.trans C Function/C Functions

cfunc.trans

Command cfunc.trans C Function/C Functions
Applicable release versions: AP 6.2
Category C Functions (120)
Description equivalent to on e of several Pick/BASIC transaction processing statements depending on the "op" parameter. Valid values of "op" are:

_CP_TRANS_ONOFF Equivalent to the BASIC "TRANSACTION ON/OFF" statement. Pass in the on/off parameter in "exp", and _CP_str_null in "str".

_CP_TRANS_START Equivalent to the BASIC "BEGIN WORK {str}" statement. If no transaction name is desired, then pass 0 in "exp" and _CP_str_null in "str". If a transaction name is desired, then pass 1 in "exp" and the desired name in "str".

_CP_TRANS_COMMIT Equivalent to the BASIC "COMMIT WORK" statement. Pass 0 in "exp" and _CP_str_null in "str".

_CP_TRANS_ROLLBACK Equivalent to the BASIC "ROLLBACK WORK" statement. A 0 MUST be passed in "exp" and _CP_str_null in "str".

_CP_CACHE Equivalent to the BASIC "TRANSACTION CACHE ON/OFF" statement. Pass in the on/off parameter in "exp", and _CP_str_null in "str".

_CP_FLUSH Equivalent to the BASIC "TRANSACTION FLUSH ON/OFF" statement. Pass in the on/off parameter in "exp", and _CP_str_null in "str".

See the BASIC "Commit Work" documentation for more information on transaction processing.

This function returns -1 if an error occurs. The error code is contained in _CP_errno and is always PE_ACCESS.
Syntax int _CP_trans(int op, int exp, CPSTR * str)
Options
Example
Purpose
Related cfunc.introduction
basic.begin.work
basic.transaction
basic.commit.work
basic.rollback.work