Unanswered: Dynamic sql in informix stored proecedure
i want to create a procedure in informix in which table name is in a variable (strTable) and i want to retrieve the records from that table. Later i will link this procedure to crystal report to create a report of the records.
Define strTable Varchar(30);
Let strTable = "Employee";
Select * from strTable;
I tried dynamic sql statements "prepare" and "execute" in the procedure but it didn't work.
CREATE PROCEDURE tempProc()
DEFINE tmpstr VARCHAR(255);
Define rgn varchar(255);
foreach curTemp For
prepare s1 from "Select Region_name from ?"
execute s1 using tmpstr
pls help me if u know any solution to this problem.