The $CURRENT_ROW function return the current row number for the result set. The first row returned from a SELECT statement is given a value of 1, and each successive row is incremented by one. This is done as the last step of a statement, and so $CURRENT_ROW can only be used as a select-item. It cannot be used in the WHERE, GROUP BY, ORDER BY or HAVING clauses.
The $CURRENT_ROW should not be confused with the $ROWID. The $ROWID comes from the underlying database, where $CURRENT_ROW is simply the current row number of the result set.
This function returns an INTEGER datatype.
$CURRENT_ROW
> select $current_row, name from individuals; $CURRENT_R NAME ---------- -------------------------------------------------- 1 MS. MARY LEWIS 2 MRS. ALICE R TOLLIVER 3 MR. SIDNEY K TOLLIVER 4 MRS. JENNIFER J HOPKINS 5 MR. CHARLIE HOPKINS 6 MS. KIMBERLY BLUE 7 KATHLEEN TUCKER
See also: