OraCommit Function

Action

Commits the current transaction. All SQL statements since the last call of any of the following functions are committed:

OraLogon, OraCommit, OraRollback

Include file

Ora.bdh

Syntax

OraCommit(in hConnection: number): 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

Example

var
  hConnection : number;
  cCursor     : cursor;

dcltrans
  transaction TMain
  begin
    OraLogon(hConnection, "user", "password", "orclnet2");
    OraOpen(cCursor, hConnection);
    OraParse(cCursor, sqlInsert);
    OraBind(cCursor, ":name", SQLT_CHR, 32, 2);
    OraBind(cCursor, ":age", SQLT_INT, 0, 2);
    OraSetString(cCursor, ":name", "Bob", 1);
    OraSetInt(cCursor, ":age", 25, 1);
    OraSetString(cCursor, ":name", "Marcy", 2);
    OraSetInt(cCursor, ":age", 33, 2);
    OraExec(cCursor);
    OraClose(cCursor);
    OraCommit(hConnection);
    OraLogoff(hConnection);
  end TMain;

dclsql
  sqlInsert:
    INSERT INTO persons (name, age) VALUES (:name, :age);

Sample scripts

OraSample.bdf