Vely logo Empower C
install     tutorials     examples     documentation     license     about

11.0.11 released on Jul 25, 2022

row-count



PURPOSE:


Get number of rows returned by query.

SYNTAX:


row-count#<query name> [ to [ define ] <variable> ]


DESCRIPTION:


Use row-count# to get the number of rows returned by a query <query name> executed by run-query. Without "to" clause, the number of rows is printed out. If "to" clause is used, then the number of rows is stored to <variable>, which you can create if define is used.

row-count# can be used inside or outside a run-query (which executes the query).

EXAMPLES:


Get the number of rows:
run-query#my_query="select name from employee"
end-query
// Define variable for row-count on the spot
row-count#my_query to define row_count

if (row_count!=2) {
   <div>Number of rows is not 2, but rather it is <<pf-out "%lld", row_count>></div>
}

To use an existing variable:
num row_count;
row-count#my_query to row_count


SEE ALSO:


Database ( on-error   affected-rows   error-text   error   begin-transaction   column-count   column-data   database_queries   column-names   commit-transaction   prepared_statements   current-row   database_config_file   define-query   exec-query   loop-query   query-result   rollback-transaction   row-count   run-query   start-query  )  SEE ALL (documentation)



Copyright (c) 2022 DaSoftver LLC. Vely is a trademark of Dasoftver LLC. The software and information herein are provided "AS IS" and without any warranties or guarantees of any kind. This web page is licensed under CC-BY-SA-4.0.