Hello,
I have a problem with creation morethanone procedures in a sql script on SAP HANA system Rev 85.
drop procedure SP_Z1;
create procedure SP_Z1
as
begin
declare x int;
declare i int;
FOR i IN 1..10 DO
x := :i;
END FOR;
end;
drop procedure SP_Z2; <= error line
create procedure SP_Z2
as
begin
declare y int;
end;
Could not execute 'create procedure SP_Z1 as begin declare x int; -- for you FOR i IN 1..10 DO x := :i; END FOR; ...' in 4 ms 3 µs .
SAP DBTech JDBC: [257] (at 114): sql syntax error: incorrect syntax near "drop": line 14 col 1 (at pos 114)
I found the problem is the text “FOR” in the procedure. I tried to run the following script and got the same error message. The text “for” in comment !!!
drop procedure SP_Z1;
create procedure SP_Z1
as
begin
declare x int;
-- for you
end;
drop procedure SP_Z2; <= error line
create procedure SP_Z2
as
begin
declare y int;
end;
This means the text “for” is NOT permitted.
Can somebody help me? Doessomebodyhaveasolution?
Y.Hu