Subject | Re: Deleting a record having child records gives problem. |
---|---|
Author | aniket@cygnet-infotech.com |
Post date | 2001-10-18T12:35Z |
Hi Paul,
Thanks a lot for the prompt reply.
In this case, I do not want to allow user to delete record if child
record is present. That is why I have kept default. But when my
Delphi Application tries to delete Parent record, it shows an
exception and then my application either hangs OR behaves abnormally.
Now I do not know whether this problem is due to Delphi( I mean IB
Connection components I am using) OR due to Firbird.
and how to solve it ? please guide me ...
Best regards,
-Aniket
Thanks a lot for the prompt reply.
In this case, I do not want to allow user to delete record if child
record is present. That is why I have kept default. But when my
Delphi Application tries to delete Parent record, it shows an
exception and then my application either hangs OR behaves abnormally.
Now I do not know whether this problem is due to Delphi( I mean IB
Connection components I am using) OR due to Firbird.
and how to solve it ? please guide me ...
Best regards,
-Aniket
--- In ib-support@y..., Paul Poulain <paul@f...> wrote:
> At 10:07 18/10/01 +0000, you wrote:
> >Hello Everybody,
> >
> >I am facing a strange problem with FireBird and Delphi 5
combination.
> >I am using Interbase Components to connect to Interbase server.
> >
> >When I try to delete a record from a table that has child records
> >present in another table, it shows an execption first and then my
> >application either hangs or behaves abnormal.
> >
> >I don't know whether it is my programming mistake or some bug some
> >bug somewhere.
> >
> >It would be a great help if somebody can help.
> >
> >TIA and Best regards,
>
> The constraint between child and father must be cascade, and not
default
> value (restrict).
> With cascade, deleting the father deletes the childes, while
restrict,
> delete father is forbidden if you have childs.
>
> Note : you can also use "set null". In this case, childs are not
deleted,
> but link is set to null (no father...)
>
> Paul