unload to standart output ?
Posted in 1999
Topics: Migration, Import/Export & Data Conversion
How i can unload database to standart output ?
Serg Shejkin wrote:
> How i can unload database to standart output ?
ON many modern versions of Unix:
UNLOAD TO "/dev/stdout" SELECT ...
Obnoxio asked "Why would you want to do it?"
Obviously, to be able to send the output of the load
through a filter before filing it. Usually, I'd agree,
the filtering can be done with the SELECT statement, but
not always. Suppose you need to transform the DATETIME fields
into 03JAN1990 format fields; that can't readily be done inside
Informix tools.
Alternatively, get SQLCMD from the IIUG archives. One of its
tools is sqlunload (link to sqlcmd), and it writes to stdout by
default (-o file overrides). Also, SQLCMD simulates /dev/stdout
(and /dev/stdin, /dev/stderr) on systems without the actual devices.
(Actually, even on systems with the devices, though the next version
will autoconfigure itself to use the devices when they're available.)
--
Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net)
Guardian of DBD::Informix v0.60 -- see http://www.perl.com/CPAN
#include <disclaimer.h>