Subject Re: [IBO] Setting Master/Detail with TIBO Datasets
Author Jason Wharton
Please use the GeneratorLinks capability instead of having the trigger
supply the key values.
If you don't give the client the key column values how do you expect it to
know what values to give the detail records?

Make your trigger only assign a value if the key columns are NULL too.

Regards,
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com

-- We may not have it all together --
-- But together we have it all --


----- Original Message -----
From: "gjannotti" <glaucio@...>
To: <IBObjects@yahoogroups.com>
Sent: Monday, September 16, 2002 12:03 PM
Subject: [IBO] Setting Master/Detail with TIBO Datasets


I have the scenario:
2 TIBOQuery´s with a Master/Detail relationship.

The first (master) is set to table COMPRAS with the structure above:
ID INTEGER PK
NUMERO INTEGER
COD_FORNECEDOR INTEGER FK(FORNECEDORES)
VALOR NUMERIC(10,2)

The PK (ID) is a autoincrement field with a generator set into the
before_insert trigger.

The second (detail) is set to table ITENSCOMPRAS with the structure
above:
ID INTEGER PK
ID_COMPRA INTEGER FK(COMPRAS)
COD_PRODUTO INTEGER FK(PRODUTOS)
QTD INTEGER
PRECO NUMERIC(10,2)

The PK (ID) is a autoincrement field with a generator set into the
before_insert trigger.

Why can i configure these two Datasets properties (KEYLINKS...) to
the master/detail relation work whell.

The biggest problem is: The detail table isn´t getting the value of
the field ID of the table COMPRAS.
I have set the propertie GeneratorLink of the table COMPRAS to get
the value of the last value of the Generator, but it don´t work to
the detail rows.

[]´s
Glaucio Jannotti