ALLBASE/SQL Reference Manual (36216-90216)

478 Chapter11
SQL Statements E - R
REFETCH
Read Input. If an update is needed:
begin
read updatevalue;
EXEC SQL REFETCH C1 INTO :Host2;
if SQLCA.sqlcode <> 0 then
begin
EXEC SQL SQLEXPLAIN :sqlmessage;
write sqlmessage;
goto 1000;
end;
if Host1 = Host2 then
EXEC SQL UPDATE T1 SET Col1 = updatevalue
WHERE CURRENT OF C1;
else
write "data changed to ", Host2;
end;
1000:
until SQLCA.sqlcode = 100
No More Rows Found