Determining the Number of Rows from and SQL Statement

To determine the number of rows retrieved or if data was selected in an SQL statement, use one of the following techniques:

Technique 1
begin-report
do count_rows
do return_true
end-report
Technique 2 
begin-procedure count_rows
move 0 to #count ! This is optional unless main1 is called more than once
begin-select
column1
column2
column3
add 1 to #count
from table1
end-select
if #count > 0
show 'Number of rows selected was ' #count edit 999
else
show 'No rows selected'
end-if
end-procedure main1

begin-procedure return_true
begin-select
'true' &true
column1
column2
column3
from table1
end-select
if &true = 'true'
show 'Selected at least one row'
else
show 'No rows selected'
end-if
end-procedure