Subject | RE: [firebird-support] How can I resolvce this |
---|---|
Author | Alan McDonald |
Post date | 2006-11-30T06:00:48Z |
> How can I resolvce thisWell, a foreign key contraint with a cascade delete would be the way I would
>
>
> Been using in FB.1.5.3 and lower
>
> DELETE FROM TICKETITEMS WHERE TICKET_UNIQUENUM
> NOT IN (SELECT TICKET_UNIQUENUM FROM TICKETS);
>
> it took less than a second
>
> but in FB.2.0.0.0 it never completes.
>
> Thank You
> Hans
do it. Then you never have to use this sort of query. there would never be
orphans in the first place.
But I suppose you're going to balk at that so we have to offer another way.
This query shouldn't "never complete". I wonder if you have introduced some
other triggers/constraints into the design when moving to FB2?
Try this
> DELETE FROM TICKETITEMS I WHERE I.TICKET_UNIQUENUMAlan
> NOT IN (SELECT T.TICKET_UNIQUENUM FROM TICKETS T);