SV: [firebird-support] Re: delete from table... best way?

2011-09-16 Thread Svein Erling Tysvær
>Now I want to delete all cars that *has* a record in "drivers", but the >driver_name is null > >so far, I always do > >delete from cars >where >( > select drivers.driver_name > from drivers > where > cars.id_drivers = drivers.id > ) > is null > >that works fine, but I just wander if there i

Re: [firebird-support] Re: delete from table... best way?

2011-09-15 Thread Gordon Niessen
On 9/15/2011 4:17 PM, Sergio wrote: > ... foreign key (id_driver) references drivers(id)... What Daniel was indicating is that if the foreign key was set to cascade, then when you deleted the associated driver, then the cars would also be deleted. You may have is currently set to change the ID

[firebird-support] Re: delete from table... best way?

2011-09-15 Thread Sergio
> Not sure what your use is - but if you have t1.id_t2 defined as a > foreign key with cascading deletes, then you can never have a t2.id null > and any delete of t1 will cascade and automatically delete the > associated records in t2. Thanks for answer! Probably I wasn't clear enough... here'