Subject Re: [firebird-support] External Tables with Indexes
Author Helen Borrie
At 09:01 PM 1/09/2003 +0000, you wrote:
>Hi group...
>Are there any way to use Indexes in External Tables??... i've been
>trying with IB 6 but that is not allowed i think....
>Any version of FireBird allows this???... or where is the trick to
>make this in IB 6???
>Thanx in advice...

No, because these data are not controlled inside the database. Consider
the corruption that could occur if such indexing were possible and an
external application deleted records or changed indexed values...

The "trick" is to recognise that external tables are just a holding place
for external data.

If you need indexing, ref integrity, triggers, etc., then have a
corresponding internal table of the required structure, with the required
constraints, and run a stored procedure to transfer the data from the
external table.

If needed, your SP can delete all the records from the external table when
the transfer is complete. You can use "After" triggers on the real table
to insert new records in the external table to reflect inserts and updates
to the real table.