Using the Inquire_ingres Statement
The following QUEL example uses rowcount to determine how many rows were found by a retrieve statement. It can also be used to see how many rows were added by an append statement or affected by a replace or delete statement:
partstbl := retrieve (parts.all);
inquire_ingres (rcount = rowcount);
if rcount < 1 then
message "No records were found";
endif;
When used in conjunction with retrieve statements, the following rules apply:
• A singleton retrieve always causes inquire_ingres to return a value of 0 or 1 for rowcount.
• For attached queries, the value is the number of rows actually viewed by the user, as controlled by the next statement in the submenu.
This example uses errorno and errortext to check the results of a database operation:
delete employee
where employee.empnum = empnum;
inquire_ingres (errno = errorno,
txt = errortext);
if errno != 0 then
message "Delete error " + varchar(errno) + " " + txt;
sleep 3;
endif;
Last modified date: 08/14/2024