on 2023 Jun 22 9:08 AM
Can somebody tell me which mistake am I doing, why I get syntax error with this block?
create or replace procedure myproc() begin declare myvar int; set myvar = 1; while myvar <10 begin set myvar= myvar+1; end; end;
Request clarification before answering.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
46 | |
6 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.