Re: sql question
From: Gert Brinkmann <gbrinkmann_at_dimedis.de>
Date: 1997/12/09
Message-ID: <348D08F8.53A7_at_dimedis.de>#1/1
Date: 1997/12/09
Message-ID: <348D08F8.53A7_at_dimedis.de>#1/1
john_at_rl.is wrote:
> Never done this kind of stuff but it might be faster to do something
> along the lines of:
>
> BEGIN WORK;
> CREATE TABLE NewTable (...);
> LOCK TABLE NewTable IN EXCLUSIVE MODE;
> INSERT INTO NewTable SELECT DISTINCT * FROM OldTable;
> DROP TABLE OldTable;
> RENAME TABLE NewTable TO OldTable;
> CREATE INDEX ...;
> COMMIT WORK;
What happens if there are (primary-key)-references to OldTable and it is
dropped ? Are the references "reactivated" after the renaming ? Or is
the state of the database inconsistent in any way afterwards ?
Gert.
-- Gert Brinkmann email: gbrinkmann_at_dimedis.de Software Development tel: 0221/921260-0 dimedis GmbH fax: -99 Habsburgerring 2-12 http://www.dimedis.de 50674 Koeln http://www.RealTimeImage.deReceived on Tue Dec 09 1997 - 00:00:00 CET