OraAutoCommit Function

Action

Enables or disables autocommit. If autocommit is enabled, every SQL data manipulation statement is automatically committed. Otherwise, OraCommit function calls are necessary to commit SQL statements.

Include file

Ora.bdh

Syntax

OraAutoCommit( in hConnection : number,
               in bAuto       : boolean): boolean;

Return value

  • true if successful

  • false otherwise. In this case, you can use the OraOciError function to retrieve the Oracle OCI error code

Parameter Description
hConnection Handle to the database connection
bAuto
  • If this parameter is set to true, autocommit is enabled

  • If this parameter is set to false, autocommit is disabled

Example

var
  hConnection: number;

dcltrans
  transaction TMain
  var
  bOk: boolean;
  begin
    OraLogon(hConnection, "user", "password", "orclnet2");
    bOk := OraAutoCommit(hConnection, true);
    if bOk thenwrite("Autocommit successfully set");
      writeln;
    elsewrite("Autocommit could not be set");
      writeln;
  end;
  OraLogoff(hConnection);
end TMain;

Output

Autocommit successfully set