Hi.
I have a big deal using master-detail.
dataset A is master for dataset B.
I insert a master with success. then i insert a detail with success. As i try to insert another detail i get an error of integrity constraint. Here the pseudo code...
-------------------------------------------
A,B are TOracleDtaset
MasterPk is integer
GetNewMasterPK,GetNewDetailPk are functions returning new pk
MasterPk := GetNewMasterPK;
A.insert; --> OK
A.fieldbyname('PK').Value := MasterPk; --> OK
DetailPk := GetNewDetailPk ;
B.insert; --> OK;
B.fieldbyname('PK').Value := GetNewDetailPK; --> OK
b.fieldbyname('FK').Value := MasterPK; --> OK
DetailPk := GetNewDetailPk;
B.insert; --> Foreign key error!!
Can you help me??
I have a big deal using master-detail.
dataset A is master for dataset B.
I insert a master with success. then i insert a detail with success. As i try to insert another detail i get an error of integrity constraint. Here the pseudo code...
-------------------------------------------
A,B are TOracleDtaset
MasterPk is integer
GetNewMasterPK,GetNewDetailPk are functions returning new pk
MasterPk := GetNewMasterPK;
A.insert; --> OK
A.fieldbyname('PK').Value := MasterPk; --> OK
DetailPk := GetNewDetailPk ;
B.insert; --> OK;
B.fieldbyname('PK').Value := GetNewDetailPK; --> OK
b.fieldbyname('FK').Value := MasterPK; --> OK
DetailPk := GetNewDetailPk;
B.insert; --> Foreign key error!!
Can you help me??