Column names in unload
Posted in 2000
Topics: Migration, Import/Export & Data Conversion
Hi there, Is it possible to include the column names when I do a UNLOAD TO....SELECT.... statement? Thanks! Kenneth Sent via Deja.com http://www.deja.com/ Before you buy.
hktkenneth@my-deja.com wrote: > Is it possible to include the column names when I do a > UNLOAD TO....SELECT.... statement? In the standard Informix products, no. The closest approach is: OUTPUT TO "somefile" SELECT ... However, that does not guarantee that you get UNLOAD format; you might get the columns down the page format instead. However, it just so happens that SQLCMD has options -H (for headings) and -T (for types) which can be used in conjunction with UNLOAD to get the column names (and/or types) into the unload file: sqlcmd -d stores -HT 'unload to "junk" select * from customer' sqlcmd -UHTd stores -t customer -o junk sqlunload -HTd stores -t customer -o junk -- Yours, Jonathan Leffler (Jonathan.Leffler@Informix.com) #include <disclaimer.h> Guardian of DBD::Informix v1.00.PC1 -- http://www.perl.com/CPAN "I don't suffer from insanity; I enjoy every minute of it!"