Ora8TransRollback Function

Action

Rolls back the current transaction.

Include file

Ora8.bdh

Syntax

Ora8TransRollback( in hSvcCtx  : number,
                   in nOptions : number optional ) : boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
hSvcCtx The service context handle.
nOptions

Flags (optional).

The only valid mode is OCI_DEFAULT.

Omit the parameter in order to use the default parameter.

Example

var
  ghEnv0        : number;
  ghError0      : number;
  ghStmt0       : number;
  ghSvcCtx0     : number;

dcltrans
  transaction TMain
  begin
    Ora8Init(ghEnv0, OCI_DEFAULT);
    Ora8HandleAlloc(ghEnv0, ghError0, OCI_HTYPE_ERROR);
    Ora8Logon(ghEnv0, ghSvcCtx0, "user", "password", "orclnet2");

    Ora8HandleAlloc(ghEnv0, ghStmt0, OCI_HTYPE_STMT);
    Ora8StmtPrepare(ghStmt0, sqlDelete, OCI_NTV_SYNTAX);
    Ora8StmtExecute(ghSvcCtx0, ghStmt0);

    Ora8TransRollback(ghSvcCtx0);
    Ora8HandleFree(ghStmt0, OCI_HTYPE_STMT);
    Ora8Logoff(ghSvcCtx0);
    Ora8HandleFree(ghError0, OCI_HTYPE_ERROR);
    Ora8HandleFree(ghEnv0, OCI_HTYPE_ENV);
  end TMain;

dclsql
  sqlDelete:
    DELETE FROM persons;

See also

Oracle's Programmer's Guide to Oracle Call Interface for Wrapped Oracle function: OCITransRollback