external tables with Informix > 7.24
Posted in 1999
Topics: General Discussion
Hi everybody, 1. I've got the problem of dealing with external files in INFORMIX. I heard that there's a command "CREATE EXTERNAL TABLE" in Informix, allowing to declare a file as a table. Does anyone know about it? 2. Is there a way to produce a file containing the result of a SELECT-statement in fixed-length format, one record per line? Thank you in advance Markus
hoevermann (hoevermann@dialup.nacamar.de) wrote: : 1. I've got the problem of dealing with external files in INFORMIX. I : heard that there's a command "CREATE EXTERNAL TABLE" in Informix, : allowing to declare a file as a table. Does anyone know about it? The XPS product has a means of doing this, but only for data loading as I understand it. In the 9.X engine, you can use the Virtual Table Interface (VTI) to create just such a beast. : 2. Is there a way to produce a file containing the result of a : SELECT-statement in fixed-length format, one record per line? Well, there are several ways to do this: First, you can use a UDF that takes an UNNAMED ROW TYPE (result row set) and appends each of them to a file. This is probably the simplest thing to do. Second, you might us a VTI interface for the same purpose. The challenge is that you'll need to know what the results of your query look like before you issue it. (That is, the data types in the select list). e-mail me for a VTI <-> Data File example. KR Pb
hoevermann wrote: > 1. I've got the problem of dealing with external files in INFORMIX. I > heard that there's a command "CREATE EXTERNAL TABLE" in Informix, > allowing to declare a file as a table. Does anyone know about it? No. Chances are, if it exists, it is in Foundation.2000, and applies to the VTI (Virtual Table Interface). > 2. Is there a way to produce a file containing the result of a > SELECT-statement in fixed-length format, one record per line? As standard, not really. Your nearest approach is an ACE (or I4GL or D4GL) report which simply prints all the values at full width. Or you could poke around the IIUG web site and try SQLCMD... Requires ESQL/C or CSDK. -- Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net) Guardian of DBD::Informix v0.60 -- see http://www.perl.com/CPAN #include <disclaimer.h>