Subject Re: [ib-support] importing lots of rows
Author Helen Borrie
At 03:40 PM 09-04-02 +0200, you wrote:
>Hi,
>
> > Similar...but not identical - but if you can export your data in fixed
> > format, you can define the output file inside the database as an external
> > table.
>
>I export the data in this format:
>
>field1|field2|field3|field4|field5|

The data need to be fixed format, not delimited as your sample above, e.g.
00000009999Christmas Stocking 20011225COMPLETE 123.456 XX
(1-11) (12-37) (38-46) (47-57)
(58-68) 69-70

This example is a 70-byte fixed format "record" of 5 fields plus two bytes
at the end (represented here as 'XX") representing CR and LF characters (or
one byte if it's a Unix file). Your EXTERNAL FILE specification will need
to include a column to accommodate these "new line" characters, which you
will "lose" when you massage the data into your real table.

I usually write a trivial little program to output data in the format I
want for my external file.

>I'll look at that way of doing. Any pointers to documentation to define
>the file as an external table?

Yes, it is in Chapter 6 of the Data Definition Guide (part of the IB 6
documentation set, available from
ftp://ftpc.inprise.com/pub/interbase/techpubs/ib_b60_doc.zip

>Thanks for your help. I think I'm going to be a fervent firebird
>supporter :-)

We're all *fervent* around here. :-/

--H

All for Open and Open for All
Firebird Open SQL Database · http://firebirdsql.org ·
http://users.tpg.com.au/helebor/
_______________________________________________________