my table is aaa (a char(5))
CREATE OR REPLACE PROCEDURE zzz ()
DYNAMIC RESULT SETS 1
P1: BEGIN
Declare cID char(5) ;
Declare cc char(5) ;
Declare csql varchar(200) ;
Declare s1 varchar(200) ;
Set cID = 'a' ;
SET Csql = 'SET ? = (select a from aaa where a = :cID)' ;
PREPARE S1 FROM Csql ;
EXECUTE S1 into cc using cID ; {error this line}
print (cc) ;
END P1
I get error :
Deploy [sss]A.ZZZ Running A.ZZZ - Deploy started. Create stored procedure returns SQLCODE: -104, SQLSTATE: 42601. A.ZZZ: 14: An unexpected token "" was found following "". Expected tokens may include: "S1 into cc using cID".. SQLCODE=-104, SQLSTATE=42601, DRIVER=3.69.56 An unexpected token "" was found following "". Expected tokens may include: "S1 into cc using cID".. SQLCODE=-104, SQLSTATE=42601, DRIVER=3.69.56 A.ZZZ - Deploy failed. A.ZZZ - Roll back completed successfully.