Commit Statement

Performs a SQL commit command inside a transaction. You need not specify a commit statement at the end of a transaction because Silk Performer automatically executes a SQL commit at the end of a transaction. The commit statement permanently sets all changes to the database since the last commit; you cannot undo these changes with a rollback statement (just as you cannot rollback committed statements with any databases using native tools). The commit statement commits the work of all cursors (statement handles) that the transaction has connected to the database.

If you use a commit statement inside a transaction, you will not be able to undo (roll back) the whole transaction. Depending on the capabilities of your DBMS, result sets may be destroyed after a commit, and subsequent execution of a fetch statement without reselecting will cause an error.

Syntax

Stat = "commit".

Example

dclrand
  rArtNo: RndUniN(1..1000);

var
  v_artno, v_stock, v_quantity: number;

dcltrans
  transaction TMain
  begin
    v_artno := rArtNo;
    c1: SelArticle();
    if v_stock = 0 then
       c2: InsOrder();
    end;

    commit;
  end TMain;

dclsql
  SelArticle:
  SELECT stock,quantity
  INTO :v_stock, :v_quantity
  FROM article
  WHERE articlenumber = :v_artno;
  InsOrder:
  INSERT INTO order(articlenumber, quantity)
  VALUES(:v_artno, :v_quantity);