CSV file with SP
Posted in 1999
Topics: Stored Procedures & SPL, Migration, Import/Export & Data Conversion, Platform-Specific Issues
I have what seems to me to be a simple request. I am using Informix 7.23 on a HP-UX 10.20 box. I have created a stored procedure which has created a recordset which I want to export to a text file. My only problem is that the only way I know of writing to a file in a stored procedure would be using the "TRACE" command. ("Unload" will not work because most of the data being exported is stored in variables within the procedure whose value depends on a number of conditions.) The problem is that this command adds a "trace expression:" to the file every time it is called. How can I prevent this from happening or maybe there is a better way of doing this?? Your help or suggestions would be greatly appreciated, Benny Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.
benlag@my-deja.com wrote:
>
> I have what seems to me to be a simple request. I am using Informix 7.23
> on a HP-UX 10.20 box. I have created a stored procedure which has
> created a recordset which I want to export to a text file. My only
> problem is that the only way I know of writing to a file in a stored
> procedure would be using the "TRACE" command. ("Unload" will not work
> because most of the data being exported is stored in variables within
> the procedure whose value depends on a number of conditions.) The
Actually UNLOAD would not work anyway since it is NOT an SQL command
but a dbaccess built-in command.
> problem is that this command adds a "trace expression:" to the file
> every time it is called.
>
> How can I prevent this from happening or maybe there is a better way of
> doing this??
Nope no way at all. The best way to handle this would be to have a
shell script, 4GL program, or ESQL program that calls the stored
procedure and formats the output to a file.
Art S. Kagel
>> How can I prevent this from happening or maybe there is a better way of >> doing this?? > >Nope no way at all. The best way to handle this would be to have a >shell script, 4GL program, or ESQL program that calls the stored >procedure and formats the output to a file. Or, from the stored procedure, you can repeatedly invoke a shell that appends to the file. Bashar Chalabi CTL, London
Bashar Chalabi wrote: > > >> How can I prevent this from happening or maybe there is a better way of > >> doing this?? > > > >Nope no way at all. The best way to handle this would be to have a > >shell script, 4GL program, or ESQL program that calls the stored > >procedure and formats the output to a file. > > Or, from the stored procedure, you can repeatedly invoke a shell that > appends to the file. Not exactly a practical solution, but in a pinch... Art S. Kagel