Re: ISQL Text File Output
Posted in 1997
Topics: Server Administration, Migration, Import/Export & Data Conversion
This is a multi-part message in MIME format.
--------------246675173F51
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Jason Kruse wrote:
>
> Being new to Informix, I need a few simplem questions answered in a
> hurry. How can I pipe the output of a "Select * from table_name" to a
> text file on a SCO box running Informix? I am used to WATCOM sql
> where I run the query and execute a output command to store the result
> as a comma delimited file. Any help would be greatly appreciated.
Well, do you want the output of the select, or a comma delimited file?
If you store your select in a file with the .sql suffix, you can run:
dbaccess database_name file_name >new_file 2>&1
To get a comma delimited file is similar, except your SQL command
changes to:
UNLOAD TO file_name DELIMITER "," SELECT * FROM table_name
save this is a file with the .sql suffix, and the command is simply:
dbaccess database_name file_name
Hope that helps,
--
--------------246675173F51
Content-Type: text/plain; charset=us-ascii; name="ATT_SIG.TXT"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="ATT_SIG.TXT"
Mark.
+------------------------------------------------------------------+
|Mark D. Stock - The West Solutions Group http://www.west.co.za |
| The Informix FAQ is at http://www.iiug.org |
|mailto:marks@west.co.za +-----------------------------------------+
|Tel: +27 11 803 2151 |If it doesn't work, force it! |
|Fax: +27 11 803 2189 |If it breaks, it needed replacing anyway!|
|Cell: +27 83 250 2325 |Well, that's how I code anyway! |
+------------------------+-----------------------------------------+
--------------246675173F51--