Subject | Re: [ib-support] Re: delete and join syntax |
---|---|
Author | Dimitry Sibiryakov |
Post date | 2002-04-24T05:53:03Z |
On 23 Apr 2002 at 22:44, mmenaz wrote:
trigger. If it is the case, you can turn the query inside out, using
FOR SELECT ... DO. For example:
FOR SELECT primary_key FROM PROGRESSIVI_CONTABILI JOIN ....
INTO :Some_variable DO
DELETE FROM PROGRESSIVI_CONTABILI WHERE primary_key=:Some_variable;
This should work faster than EXISTS(..).
I don't know if it is possible to use RDB$DB_KEY or a cursor and
"DELETE ... WHERE CURRENT OF" in this case because of joins.
By the way, is it possible to DECLARE VARIABLE for storing the
value of RDB$DB_KEY?
SY, Dimitry Sibiryakov.
> DELETE FROM PROGRESSIVI_CONTABILI[skipped]
> WHERE EXISTS (SELECT * FROM PROGRESSIVI_CONTABILI
> INNER JOIN UNITA_U_CLIENTI ON
>Is this the only, correct way of doing things with delete? Or is thereBecause of "OLD.UICC_ID" I decided that this query is a part of a
>a join syntax for that purpouse? Searching google I've found that
>syntax used, but I don't know if were good advices or not ;) Thanks
trigger. If it is the case, you can turn the query inside out, using
FOR SELECT ... DO. For example:
FOR SELECT primary_key FROM PROGRESSIVI_CONTABILI JOIN ....
INTO :Some_variable DO
DELETE FROM PROGRESSIVI_CONTABILI WHERE primary_key=:Some_variable;
This should work faster than EXISTS(..).
I don't know if it is possible to use RDB$DB_KEY or a cursor and
"DELETE ... WHERE CURRENT OF" in this case because of joins.
By the way, is it possible to DECLARE VARIABLE for storing the
value of RDB$DB_KEY?
SY, Dimitry Sibiryakov.