Subject RE: [firebird-support] Import data from flat files
Author Oleg Lebedev
Well, this would probably speed up the insertions, but then I would have
to spend more time on formatting file data. I could write a program to
do this, but since this is a one-time date import, it would not worth
the trouble.

-----Original Message-----
From: Aage Johansen [mailto:aagjohan@...]
Sent: Tuesday, September 30, 2003 12:51 PM
Subject: Re: [firebird-support] Import data from flat files
Importance: Low

On Tue, 30 Sep 2003 17:22:02 +0000 (UTC), Oleg Lebedev wrote:

> Well, This seems like a convoluted way to import data from a flat
file > into a database. > What I ended up doing is importing data from
a flat file into my > PostgreSQL database. Then, using postgres pg_dump
utility, I exported > data from the postgres database in a file in a
form of INSERT > statements. Finally, I created my table in my FB
database and ran the > INSERTs script in there.

Using a script with INSERT statement surely must be slow!

Is the file with separators (|) the only format you can provide? (Use
fixed size fonts to read this!) If
1|36901|O|173665.47|1996-01-02|5-LOW|Clerk#000000951|0|blithely ...
2|78002|O|46929.18|1996-12-01|1-URGENT|Clerk#000000880|0|quickly ...
could be transformed into (removing separators, using fixed length
136901O173665.471996-01-025-LOW Clerk#000000951|0|blithely ...
278002O 46929.181996-12-011-URGENTClerk#000000880|0|quickly ... ... you
can use the (very fast) external tables with a table definition like
o_orderkey char(1),
o_custkey char(5),
o_orderstatus char(1),
o_totalprice char(9),
o_orderdate char(10),
o_orderpriority char(8),
o_clerk char (...),
(adjusted to your needs).

Aage J.

To unsubscribe from this group, send an email to:

Your use of Yahoo! Groups is subject to


This e-mail may contain privileged or confidential material intended for the named recipient only.
If you are not the named recipient, delete this message and all attachments.
Unauthorized reviewing, copying, printing, disclosing, or otherwise using information in this e-mail is prohibited.
We reserve the right to monitor e-mail sent through our network.