In my old version 3.50 this works - after upgrade to 4.40 i have got the following problem
A simple SQL
Select *
from TableA, TableB
Where
TableA.Field1 = TableB.Field1
and
TableA.Field1 = :Field1
I get the error : Field1 is ambiguous
Masterdatasource - has Field1
A look in the DBMoitorer
Shows that the real SQL send to MySql is
Select *
from TableA, TableB
Where
( TableA.Field1 = TableB.Field1
and
TableA.Field1 = :Field1) and Field1 = :Field1
What to do
/Per
Master - Details
This looks like you have combined two types of master/detail relationship in this example:
1. by parameters, because the following condition appears in your query: TableA.Field1 = :Field1;
2. by MasterFields/DetailFields, because the following condition appears in the query caught by DBMoitor: and Field1 = :Field1. It is added by MyDAC.
There is no need to use both links simultaneously for a single relationship. If you decide to use the first link type, you should just clear the MasterFields and the DetailFields properties. Otherwise you should remove this condition: TableA.Field1 = :Field1 from your detail query and change the DetailFields property so that field name appears with the table name: TableA.Field1.
1. by parameters, because the following condition appears in your query: TableA.Field1 = :Field1;
2. by MasterFields/DetailFields, because the following condition appears in the query caught by DBMoitor: and Field1 = :Field1. It is added by MyDAC.
There is no need to use both links simultaneously for a single relationship. If you decide to use the first link type, you should just clear the MasterFields and the DetailFields properties. Otherwise you should remove this condition: TableA.Field1 = :Field1 from your detail query and change the DetailFields property so that field name appears with the table name: TableA.Field1.