Board index » delphi » Exporting InterBase table to text file

Exporting InterBase table to text file

I have an app. which exports IB tables to text files which works fine until
I get to a table with 15 million records.  I'm using TQuery to access the
table and cycling through the records using Next, but I get an error,
something like "Temporary Table Limit Reached" around 14.5 million records.
Anyone know how to stop the BDE from caching fetched records? I've tried
setting UniDirectional to True, but it didn't work.

Any suggestions would be greatly apprieciated.

Thanks,
Patrick

 

Re:Exporting InterBase table to text file


Have you tried the IB-specific components, and maybe using a ttable
instead of a tquery?
Quote
Patrick Noll wrote:

> I have an app. which exports IB tables to text files which works fine until
> I get to a table with 15 million records.  I'm using TQuery to access the
> table and cycling through the records using Next, but I get an error,
> something like "Temporary Table Limit Reached" around 14.5 million records.
> Anyone know how to stop the BDE from caching fetched records? I've tried
> setting UniDirectional to True, but it didn't work.

> Any suggestions would be greatly apprieciated.

> Thanks,
> Patrick

Re:Exporting InterBase table to text file


Quote
Patrick Noll <patrick.n...@csgrp.com> wrote:

: I have an app. which exports IB tables to text files which works fine until
: I get to a table with 15 million records.  I'm using TQuery to access the
: table and cycling through the records using Next, but I get an error,
: something like "Temporary Table Limit Reached" around 14.5 million records.
: Anyone know how to stop the BDE from caching fetched records? I've tried
: setting UniDirectional to True, but it didn't work.

: Any suggestions would be greatly apprieciated.

: Thanks,
: Patrick

InterBase has the facility to export directly to a flat ASCII file itself.
All you need to do is declare a new table in the database where all the
columns are CHAR(something), with a 1-1 match between the columns in the
table you are exporting and the new table.  Declare the new table using
"EXTERNAL FILE" (see the docs).  Then just do an insert into the new
table with a select from the old table.  Very fast (no network traffic),
all done with one SQL statement, no TQuery, no BDE, just InterBase at it's
best :)  This works well for inserting records too, I imported 1M records
from a flat ASCII file into a table in 20 minutes (on a slow IB server).

hth
Rowdy

Other Threads