Re: question about SQL and stored procedure
Posted in 1996
Topics: Stored Procedures & SPL, Server Administration
What I've done in the past is write the results of the queries in the
SPL to a temp table, then use this temp table when I continue my
queries in the SQL portion. I.e.:
execute procedure getdata(); -- results saved in temp1
select locdes, temp1.* from loc, temp1
where locid=temp1.vlid
order by locdes;
______________________________ Reply Separator _________________________________
Subject: question about SQL and stored procedure
Author: cu549@FreeNet.Carleton.CA (Eric W C Chan) at smtpgate
Date: 2/19/96 11:30 AM
Hi
I need some help in using the stored procedure in the where
clause of a SQL in informix. I have a stored procedure which
produces a list of keys of a table. I want to use the results
of this stored procedure in a SQL statemnet. Here is the
SQL:
select * from A where a in (execute procedure B(1))
However, dbaccess complains there is a synatx error. Then I
tried this:
select * from A where a in (B(1))
Again, the dbaccess complains there is a syntax error.
My questions are:
1) Can I pass the output of a stored procedure into the where
clause of a SQL?
2) If yes, what is the syntax?
Note: the output of my stored procedure has more than 1 rows.
Please reply by email.
Thanks
Eric
--
-----------------------------------------------------
Eric Chan
email: ericc@newbridge.com OR cu549@freenet.carleton.ca