RsRows Function

Action

Retrieves the number of rows in 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

RsRows(): number;

Return value

  • Number of rows in the result set.

Example

var
  hConnection : number;
  cCursor     : cursor;

dcltrans
  transaction TMain
  var
    nRows : number;
  begin
    OraLogon(hConnection, "user", "password", "orclnet2");
    OraOpen(cCursor, hConnection);
    OraParse(cCursor, sqlSelect);
    OraBind(cCursor, ":1", SQLT_INT);

    OraSetFloat(cCursor, ":1", 2000.0);
    OraDefine(cCursor, 1, SQLT_CHR, 32);
    OraDefine(cCursor, 2, SQLT_FLT);
    OraExec(cCursor);
    OraFetch(cCursor, ORA_FETCH_ALL);
    nRows := RsRows();

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

dclsql
  sqlSelect:
  SELECT * FROM accounts WHERE balance > :1;