Subject IBDatasets and master/detal relationship
Author iguana_xyz
Good afternoon to all, I am experiencing with firebird, IBX and a
master/detail application in Delphi 6, I have two IBDatasets one
the master
(IBDataset1) and the other the detail (IBDataset2)

In selectsql I have:

SELECT * FROM FACTURAS_DATOS
WHERE FACTURA_ID = :FACTURA_ID

In the insertsql of the detail (IBDataset2) I have:

INSERT INTO FACTURAS_DATOS
(FACTURA_ID, PARTIDA, CANTIDAD, DESCRIPCION, PRECIO)
VALUES
(:FACTURA_ID, :PARTIDA, :CANTIDAD, :DESCRIPCION,
:PRECIO)

If I do not put the following line of code in the
IBDataset2AfterInsert:

IBDataset2.FieldByName('FACTURA_ID').AsString : =
IBDataset1.FieldByName('FACTURA_ID').AsString;

The FACTURA_ID value is never generated and I receive an error
that
FACTURA_ID can not be **null**

The question is: Is this the right way to create master/detail
applications
with interbase and delphi´s ibx?? I have noticed that in ADO or
Dbexpress
the value of this link field is auto generated by the program and
you only
have to assign the mastersource parameters to the detail
dataset.

Help Please!!

Thanks and Regards

Alejandro Jourdan