Re: SPL Procedures in DB-access
Posted in 2000
Can't you do something like:
CREATE TEMP TABLE xyzzy
(
<whatever>
);
INSERT INTO xyzzy
EXECUTE PROCEDURE sp_returns_a_set();
and then use the temp table in the sub-query ?
>>> Jonathan Leffler <jleffler@earthlink.net> 01/26/00 07:23am >>>
gauthamkrishnamurti@my-deja.com wrote:
> I have been having trouble trying to incorporate a
> SPL procedure into SQL. I have an SPL procedure
> that returns a set of rows and would like to use
> as a subselect
>
> ex:
> select id from temp where id in (mysplfunction());>
> 686: Function (informix.mysplfunction) has> returned more than one row.
> Error in line 1> Near character position 1
>
> [...]
>
> The Informix documentation states that "You can
> use a Stored Procedure anywhere in an SQL
> statement where a sub query is allowed ...."
>
> Any suggestions will be much appreciated.
Arguably, a documentation error; possibly a version-dependent error.
Which version of which manual contains the quote you use?
Which version of which database server are you using?
On which platform?
In general, in an SQL statement, you can only use stored procedures
which return a single value - one row of data containing one column,
at least in the versions I'm familiar with, meaning those prior to
the IDS.2000 and Foundation.2000 (9.20) releases, and possibly 7.3x.
--
Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net)
Guardian of DBD::Informix v0.95 -- see http://www.perl.com/CPAN
#include <disclaimer.h>