Subject Re: [firebird-support] Insert SQL for master detail rel.
Author Alexandre Benson Smith
James wrote:

>Hi,
>
>Is there a special sql to add a record to two table with a master detail
>relationship?
>
>Thanks.
>
>
>regards,
>james
>
>
James,

You have to just insert on the two (or more) tables, first insert the
parent, then with the parent PK in hand, insert into the child table.

If you use a generator to populate the Parent PK, you can first get the
generator value, then insert the Parent, with a known value for he PK
and then use the same value for the child insert.

Did you tried something ?
Are you getting any error ?

see you !

--

Alexandre Benson Smith
Development
THOR Software e Comercial Ltda.
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br