Rows Function

Action

Returns the number of rows affected by the most recent SQL command if the SQL command executed with the cursor is an UPDATE, a DELETE or an INSERT command.

Syntax

rows( in cCursor : cursor ):number;

Return value

Number of rows affected by the most recent SQL command.

If the most recent SQL command executed with the cursor ident is a SELECT command, it returns the number of rows actually fetched by fetch-next or fetch-all statements associated with the SELECT command.

This function does not return the number of rows in a result set unless the rows have previously been fetched.

Parameter Description
cCursor Cursor with which the SQL command is associated

Example

 var
  v_artno, v_stock, v_quantity: number;

dcltrans
  transaction TMain
  begin
    c1: SelArticle();
    fetch c1 all;
    write("number of articles found: ");
    write(rows(c1));
  end TMain;

dclsql
  SelArticle:
    SELECT stock,quantity
    INTO :v_stock, :v_quantity
    FROM article
    WHERE articlenumber = :v_artno;