Subject Re: [firebird-support] How can I resolvce this
Author Hans
Thank you, I'll try that.
Inherited the db structure.
Had little time to go over everything with a fine tooth comb
and of course didn't consider that in the first place, since it worked
OK in FB.1.xx :)

----- Original Message -----
From: "Alan McDonald" <alan@...>
To: <firebird-support@yahoogroups.com>
Sent: Wednesday, November 29, 2006 11:00 PM
Subject: RE: [firebird-support] How can I resolvce this


>> How can I resolvce this
>>
>>
>> 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
>
> Well, a foreign key contraint with a cascade delete would be the way I
> would
> 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_UNIQUENUM
>> NOT IN (SELECT T.TICKET_UNIQUENUM FROM TICKETS T);
>
> Alan
>
>
>
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://www.firebirdsql.org and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Yahoo! Groups Links
>
>
>