RsVerifyInt Function

Action

Verifies a number element at a given row/column within the internal result set, which is filled whenever a data generating SQL statement is executed (SELECT statement), no matter which database API (ORA, ODBC) has generated it.

Include file

db.bdh

Syntax

RsVerifyInt( in nVerify     : number,
             in sIdentifier : string,
             in nIndex      : number optional,
             in nOptions    : number optional,
             in nSeverity   : number optional ): boolean;

Return value

  • true if verification was performed successfully,
  • false otherwise
Parameter Description
nVerify Number value to verify.
sIdentifier Identifier of the result data column.
nIndex Array index for the column item (optional).
nOptions

Options (optional).

  • DB_FLAG_NONE (default)

nSeverity Optional: Severity of the error that is raised if the verification fails. Can be one of the following values:
  • SEVERITY_SUCCESS: Success; no error (numerical value: 0)
  • SEVERITY_INFORMATIONAL: Informational; no error (numerical value: 1)
  • SEVERITY_WARNING: Warning; no error (numerical value: 2)
  • SEVERITY_ERROR: (Default) Error; simulation continues (numerical value: 3)
  • SEVERITY_TRANS_EXIT: Error; the active transaction is aborted (numerical value: 4)
  • SEVERITY_PROCESS_EXIT: Error; the simulation is aborted (numerical value: 5)

Example

var
  hConnection : number;
  cCursor     : cursor;

dcltrans
  transaction TMain
  var
    nAge  : number;
    sName : string;
  begin
    OraLogon(hConnection, "user", "password", "orclnet2");
    OraOpen(cCursor, hConnection);
    OraParse(cCursor, sqlSelect);
    OraBind(cCursor, ":1", SQLT_INT);
    OraSetInt(cCursor, ":1", 25);
    OraDefine(cCursor, 1, SQLT_CHR, 32);
    OraDefine(cCursor, 2, SQLT_INT);
    OraExec(cCursor);

    while OraFetch(cCursor) do
      sName := RsGetString("1");
      RsVerifyInt(10, "2");
      write(sName, 32); write(nAge, 5); writeln;
    end;

    OraClose(cCursor);
    OraLogoff(hConnection);
  end TMain;

dclsql
  sqlSelect:
  SELECT * FROM persons WHERE age > :1;