Re: sql question
Posted in 1997
john@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@dimedis.de
Software Development tel: 0221/921260-0
dimedis GmbH fax: -99
Habsburgerring 2-12 http://www.dimedis.de
50674 Koeln http://www.RealTimeImage.de