Master Detail ORA-00918

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ketas
Posts: 28
Joined: Thu 02 Sep 2010 12:08

Master Detail ORA-00918

Post by ketas » Wed 01 Jun 2011 12:11

Hi,

i have master toraquery with
sql "select acnt_id master_acnt_id,account_name from accounts acnt"
fields master_acnt_id and account_name

and detail toraquery :

select aagr.acnt_id detail_acnt_id, aagr.agr_id,aagr.id,agr.agname,aagr.shp_id,shp.shop_name
from acnt_artgrps aagr,artgroups agr,shops shp
where aagr.agr_id = agr.agr_id
and aagr.shp_id = shp.shp_id

fields: DETAIL_ACNT_ID, AGR_ID,ID,AGNAME,SHP_ID,SHOP_NAME

It is not possible to make master detail relation master_acnt_id->detail_acnt_id - due to error ORA-00918 - column ambiguously defined. When i delete table shops from detail toraquery (although has no column names like all other tables), everything is o.k. Could you please help me to solve this problem?

Thanks. Best Regards Vojslav

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Wed 01 Jun 2011 12:30

Hello,

To resolve the problem you should set the DetailFiled property like

Code: Select all

DetailFiled := 'aagr.acnt_id';

ketas
Posts: 28
Joined: Thu 02 Sep 2010 12:08

Post by ketas » Wed 01 Jun 2011 13:30

Hi,

many thanks, this solved my problem . I had this value "aagr.acnt_id" in field origin.

Best Regards. Vojslav

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Wed 01 Jun 2011 13:50

Hello,

Glad to see that the problem was solved. If you have any other questions, feel free to contact us.

Post Reply