ALLBASE/SQL Reference Manual (36216-90216)

Chapter 11 477
SQL Statements E - R
REFETCH
Because UPDATE WHERE CURRENT does not accept a DESCRIPTOR clause for input
values, the REFETCH statement does not support the USING DESCRIPTOR clause
found in the FETCH statement.
No BULK option is available.
This statement cannot be used interactively or in procedures.
If there is no current row during a REFETCH, you receive the following message in the
SQLCODE:
Row not found.
Authorization
You do not need authorization to use REFETCH.
Example
label 1000;
var
EXEC SQL INCLUDE SQLCA;
EXEC SQL BEGIN DECLARE SECTION;
sqlmessage : packed array [1..132] of char;
host1, host2, updatevalue : integer;
EXEC SQL END DECLARE SECTION;
begin
.
.
.
EXEC SQL BEGIN WORK RU;
EXEC SQL DECLARE C1 CURSOR FOR UPDATE OF Col1 FROM T1 WHERE Predicate;
EXEC SQL OPEN C1;
repeat
EXEC SQL FETCH C1 INTO :Host1;
if SQLCA.sqlcode <> 0 then
begin
EXEC SQL SQLEXPLAIN :sqlmessage;
write sqlmessage;
goto 1000;
end;
write Host1;