Re: Writing to a file from a Stored Procedure
Posted in 2005
Jonathan Leffler — — source: Usenet: comp.databases.informix
Harish Vamsi Mohan via DBMonster.com wrote:
> We have created a procedure which retrieves some table information. Is it
> possible to write that information to a text file from the procedure? If
> yes, please let us know the way to do it. If no, please let us know any
> workaround.
>
> A sample code for the same will be very much helpful.
CREATE PROCEDURE WriteToFile(fn varchar(128), data varchar(255))DEFINE cmd CHAR(512);
LET cmd = "echo '" || trim(data) || "' >" || trim(fn);
SYSTEM cmd;
END PROCEDURE;
Untested - might conceivably work.
--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2005.01 -- http://dbi.perl.org/