RE: Unload
Posted in 2000
Topics: Migration, Import/Export & Data Conversion
No.
Well yes, but not exactly.
If all of your unloaded fields are char, then you can do:
unload to "items.unl"select "imast_item", "imast_descext"
from systables
where tabid = 1
union all
select imast_item, imast_descext
from imast
If your unload fields aren't all char, then you have to get tricky.
Something like
select "|imast_item|imast_descext", 0, 0
from systables
where tabid = 1
union all
select "", imast_item, imast_descext
from imast
But then of course you have an extra field in the unload.
Alternately, if you're in isql, you can 'Output' to a 'New-file'
items.unl. This will give you headers like the normal isql, but no
delimiters. The best way is probably to create the header file
yourself, and then cat that and your output file to a third file.
HTH
-----Original Message-----
From: Martyn Shiner [mailto:martyn.shiner@bff-nonwovens.com]
Sent: Thursday, June 29, 2000 10:25 AM
Posted To: informix
Conversation: Unload
Subject: Unload
If I do an unload to text file like
UNLOAD to items.unl
SELECT imast_item, imast_descext FROM imast
Can I get the unload file to include column headings?
Regards
Martyn
Scott,
thanks for the reply - pity about the non-char fields. Why can't I cast them
(sorry I'm new to informix!!)?
like
unload to "items.unl"select "imast_item", "imast_descext", "imast_cost"
from systables
where tabid = 1
union all
select imast_item, imast_descext, cast(imast_cost AS char)
from imast
Regards
Martyn