External Firebird Tables

I’m trying to find a way to quickly load a lot of data into a database, and I was offered to use external Firebird tables, I would like to know more about this method, I tried searching on the Internet, but I don’t get useful information about it, I want to know how they really work? Should the tables be the same? and what if you load data from multiple databases?

+5
source share
1 answer

Use external tables as follows:

CREATE TABLE ext1 EXTERNAL 'c:\myfile.txt' ( field1 char(20), field2 smallint ); 

To make a quick import to a regular table, do the following:

 INSERT INTO realtable1 (field1, field2) SELECT field1, field2 FROM ext1; 

Remember to disable triggers and indexes (if possible) before loading and reactivate them afterwards.

This information is from the Firebird FAQ: http://www.firebirdfaq.org/faq209/

Here is more information about using external tables, including file format information: http://www.delphiman.de/Bin/UsingExternalFilesAsTables.pdf

+6
source

Source: https://habr.com/ru/post/1201209/


All Articles