High-level Interface

The Silk Performer scripting language is easy to read and provides a high-level database access interface. The following example shows the TSelling transaction of a stock inventory management system using the high-level interface.

use "DBAPI.bdh"

dclrand
  rAno: RndUniN(1..2000);

var
  ano, stock: number;

dcltrans
  transaction TSelling
  var
    i: number;
  begin
    for i := 1 to RndUniN(4..7) do
      ano := rAno;
      c1: SelArticle();
      c2: UpdStock();
    end;
  end TSelling;

dclsql
  SelArticle:  SELECT a_name, a_cat, a_price, a_stock
  INTO *, *, *, :stock FROM article
  WHERE a_no = :ano;
  UpdStock:
  UPDATE article SET a_stock = 99999
  WHERE a_no = :ano;