Contains a count of the number of rows either fetched to Panther or affected by the previous statement
The use of this variable is dependent on the database engine. On all engines,
@dmrowcountis set to the number of rows fetched to Panther variables in a
CONTINUEcommand. On some engines, it can also reflect the number of rows affected by an
@dmrowcountis set to 0 before each new
DBMScommand is executed. You must copy its value to another location if you want to use the value after subsequent commands.
If the command fetches rows, Panther updates
@dmrowcountwriting the number of rows fetched to Panther variables. Most SQL syntaxes provide an aggregate function
COUNTto count the number of values in a column or the number of rows in a select set. The value of
@dmrowcountis not the number of rows in a select set; rather, it is the number of rows returned to Panther variables. Therefore if a select set has 14 rows in total, and its target Panther variables are arrays, each with ten occurrences,
@dmrowcountis 10 after the
SELECTis executed, and 4 after
CONTINUEis executed. If
CONTINUEis executed a second time,
@dmrowcountwould equal 0.
The value of
@dmrowcountis either less than or equal to the maximum number of rows that can be written to the target Panther destinations; the maximum number of rows is the number of occurrences in a destination variable. If the value in
@dmrowcountis less than the maximum number of occurrences, then the entire select set is written to the target variables and no further processing is needed. If
@dmrowcountequals the maximum number of occurrences, then the
SELECTmight fetch more rows than can fit in the variables. To display the rest of the select set, the application must execute
@dmrowcountis less than the maximum number of occurrences (or equals 0) or until
For information on whether the variable can be used to obtain the number of rows affected by an
DELETEstatement, refer to the Database Drivers for the specified engine.
If you are using the transaction manager, call
TM_OCC_COUNT) to find the number of rows fetched in the current server view. Since a transaction command can consist of more than one
@dmrowcountmight have already been overwritten.
DBMS QUERY SELECT * FROM titles WHERE genre_code=:+type
# If rows are returned but not the NO_MORE_ROWS code,
# let the user know there are rows pending.
if (@dmrowcount > 0) && \
(@dmretcode != DM_NO_MORE_ROWS)
msg setbkstat "Press %KPF1 to see more."
msg setbkstat "All rows returned."
# This function is called by pressing PF1.
# It retrieves the next set of rows.