Export DB to Ascii
Posted in 1995
> Hi, may someone point me to some reference or way to export a table of a DB
> in Informix to an ASCII file.
>
>
> Thanks.
> Regards, Vincent Wong
RTFM! References include:
OnLine Administrator's Guide v5.0
pgs 4-40 thru 4-52 "Db & Table Migration"
SQL Reference Manual v4.0
pgs 2-145 "UNLOAD statement"
Guide to SQL Tutorial Dec 1991
index entry for UNLOAD (exporting data to a file)
[granted, there is no entry under EXPORT. There should be, tho']
pg 9-29:
"You can use the UNLOAD command of DB-Access, Informix-SQL
or Informix-4GL, or you can write a report in ACE or
Informix-4GL and direct the output to a file."
My favorites are:
in SQL:
UNLOAD TO filename
SELECT * FROM tablename
WHERE fieldname = criterionuse this when you will be loading data right back into Informix, because
it will default to a | delimiter (other db's might not accept that)
in ACE:
same select but print with a USING statement (SQL Reference, v4.0
page 5-101) to achieve formatting of dates, numbers, and amounts
and from the command line:
$ dbexportwhich unloads a schema and an entire database into ASCII files.
You didn't say what you are going to do with the unloaded data. If you
are loading it back into an Informix db then watch out for the logical
logs (you may have to turn logging off to do the load, see OnLine
Administrator's Guide pg 3-29.)
That ought to get you started...
__________________________________________________________________
| Clem Akins Standard Disclaimers Apply |
|Reynolds Metals Co, Alloys Plant "Climb High, Cave Deep!" |
| Muscle Shoals, Alabama USA cwakins@leia.alloys.rmc.com |
|________________________________________________________________|