dbTalk Databases Forums  

dynamic sql and timeseries problem

comp.databases.informix comp.databases.informix


Discuss dynamic sql and timeseries problem in the comp.databases.informix forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Rick Fahey
 
Posts: n/a

Default 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.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.