LOTOFILE and Stored Procedures
Posted in 2011
Topics: SQL Development & Query Writing, Stored Procedures & SPL
Hi,
I want to use the LOTOFILE function in a stored procedure!
Here is the sql I have tried:
CREATE PROCEDURE export_byteblob()
DEFINE akt_filename char(20);
DEFINE new_filename char(20);
FOREACH SELECT sta_file INTO akt_filename FROM stand
SELECT LOTOFILE(byteblob_blob, '/tmp/'||TRIM(new_filename)||'!', 'server')
FROM byteblob
WHERE byteblob_name MATCHES akt_filename;
END FOREACH;
END PROCEDURE;
Trying this code I get an Informix Error 659: INTO TEMP table required for
SELECT statement.What am I doing wring??
THANKS!!!
On Mon, Jul 11, 2011 at 08:05, HANS MEYER <drinxx@gmx.net> wrote:
> I want to use the LOTOFILE function in a stored procedure!
> Here is the sql I have tried:
>
> CREATE PROCEDURE export_byteblob()>
> DEFINE akt_filename char(20);
> DEFINE new_filename char(20);
>
> FOREACH SELECT sta_file INTO akt_filename FROM stand
>
First SELECT, correctly attached to a FOREACH loop.
> SELECT LOTOFILE(byteblob_blob, '/tmp/'||TRIM(new_filename)||'!', 'server')
>
> FROM byteblob
>
> WHERE byteblob_name MATCHES akt_filename;
>
Second SELECT, with no INTO clause to receive the values or INTO TEMP clause
to store the values, and not attached to a FOREACH loop.
> END FOREACH;
> END PROCEDURE;
>
> Trying this code I get an Informix Error 659: INTO TEMP table required for
> SELECT statement.> What am I doing wring??
>
Choose one of the three options.
--
Jonathan Leffler <jonathan.leffler@gmail.com> #include <disclaimer.h>
Guardian of DBD::Informix - v2011.0612 - http://dbi.perl.org
"Blessed are we who can laugh at ourselves, for we shall never cease to be
amused."
--0015176f0750c0ae4a04a7d07b79