You are mixing your Watcom SQL and Transact-SQL into the same procedure. The brackets after the procedure name and the BEGIN..END after the procedure definition is Watcom-SQL, but you're trying to use the Transact-SQL version of the WHILE statement (i.e. no LOOP..END LOOP). You alternative SQL for the procedure is all Watcom-SQL. answered 22 Jun '23, 08:40 Reg Domaratzki |
as alternative this has worked:
The correct syntax for WHILE is
WHILE...LOOP END LOOP;
The loop name is optional. See LOOP in the documentation for a complete discussion.