Gets the number of qualifying tuples in window SELECT statement.

Available in:

Apps (win) Apps (char) Reportwriter RPC Standalone PL
X X      


numeric query_count([add-where[,add-end]])
string           add-where,add-end


Returns the number of qualifying tuples in window SELECT.
add-where (optional) is appended to the # where_begin # where_end sequence; WHERE and AND are inserted where needed.

add-end (optional) is appended to the SELECT statement; no blank is inserted before add-end.


Prompts user for confirmation before fetching data:
numeric cnt;
char    answer[1];
cnt    = query_count();
answer = prompt("Query returns " ^^ cnt ^^ " tuples.  OK(Y/N)?");
if (answer in ("Y","y")) query(cnt);