Re: Export to ASCII file
Posted in 2001
At 17:03 01/01/09 +0000, Stuart wrote:
Hi Stuart.
It is an excerpt from Informix Guide to SQL.
UNLOAD
Use the UNLOAD statement to write the rows retrieved in a SELECT statement
to an operating-system file.
Use this statement with DB-Access and SQL Editor.
See also Informix Guide to SQL 2-615.
How about use SYSTEM ?
e.g
create procedure test ()
....
system 'dbaccess stores_demo aa.sql'; ...
end procedure;
aa.sql
unload to 'unload.unl' select * from customer where fname = "Tsutomu";
>I am trying to export a table to an ASCII file in a stored procedure on a
>UNIX box.
>
>I was using :
>
>Unload to 'file'
>select * from my_table
>where field = "123";>
>Which causes a syntax error.
>
>Is 'unload' a command that i can use in stored procedures, or is it only
>useable in the 'dbacess' program?
>
>
Regards.
--
Tsutomu Ogiwara
Technical Group & Red Brick Group, Informix Sales Promotion Dept
CTC, ITOCHU Techno-Science Corporation
Yasukuni Kudan-Minami Bldg., 2-3-14, Kudan-Minami Chiyoda-Ku TOKYO,
102-0074 JAPAN
Phone:+81-3-5212-4891 Fax:+81-3-5212-4889
E-mail:Tsutomu.Ogiwara@ctc-g.co.jp / tsutoo@my-deja.com