dynamic sql and timeseries problem -
09-27-2011
, 01:26 PM
I am trying to write a procedure that uses dynamic sql to run some of
the timeseries functions.
I can successfully run the following statement in dbaccess, and from
within a storedprocedure.
insert into realfeed_526931_data_min values("A","B",
111,222,tscreateirr("realfeed_min_cal","2011-09-21 13:00:11.12370",
20,0,0,NULL))
But when I try to run it from within the procedure using dynamic sql
via ‘execute immediate’, I get a -659 error.
Even if I don’t dynamically build the SQL, rather just put it in a
variable and then execute it, I get the -659 error.
Here is a snipet from the trace.
EXECUTE IMMEDIATE insert into realfeed_526931_data_min values("A","B",
111,222,tscreateirr("realfeed_min_cal","2011-09-21 13:00:11.12370",
20,0,0,NULL))
insert into realfeed_526931_data_min
values ("A", "B", 111, 222, (<procedure> tscreateirr,
"realfeed_min_cal", "2011-09-21 13:00:11.12370", 20, 0, 0, <NULL> ));
execute function informix.tscreateirr[procid=562] ( arg[0] =
realfeed_min_cal , arg[1] = 2011-09-21 13:00:11.12370 , arg[2] =
20 , arg[3] = 0 , arg[4] = 0 , arg[5] = NULL. )
exception : looking for handler
SQL error = -659 ISAM error = 0 error string = = ""
exception : handler FOUND
-659 INTO TEMP table required for SELECT statement.
A SELECT statement did not specify where to put the returned values.
SELECT statements within a procedure require either an INTO TEMP
clause
or an INTO clause that references the appropriate procedural
variables.
I assume the tscreateirr function must be doing something that isn’t
compatible with dynamic sql in SPL.
Im wondering if anyone has run into this problem, and whether there is
a way to use these TimeSeries functions within dynamic sql in a stored
procedure.
This is AIX 6.1 on IDS 11.70 FC3. |