query retrieves not all records

rbarth

Member
i'm not sure if this is the right forum for my problem, but it seems to depend on doa.

when i exec a special select statement i only get 1 record instead of 7.

i use delphi5, midas, doa, oracle8.

select
d1.AK ,
d1.PR ,
d1.TP ,
d2.PO ,
d2.PM ,
d2.VB
from
lsv.d5160_01 d1,
lsv.d5160_02 d2
where
d2.ak(+) = d1.ak and
d2.pr(+) = d1.pr and
d2.tp(+) = d1.tp and
(d1.pd >= '01.01.2001') and (d1.pd < '02.01.2001')

primary key of d1 is AK, PR, TP.
primary key of d2 is AK, PR, TP, PM.

in the oracle worksheet i get 7 records.
when i use doa without midas i get 7 records.
when i use midas and bde i get 7 records.
when i use midas and doa i get only 1 record.

when i use midas and doa i get 7 record if i remove d1.TP from query:
select
d1.AK ,
d1.PR ,
d2.PO ,
d2.PM ,
d2.VB
from
lsv.d5160_01 d1,
lsv.d5160_02 d2
where
d2.ak(+) = d1.ak and
d2.pr(+) = d1.pr and
d2.tp(+) = d1.tp and
(d1.pd >= '01.01.2001') and (d1.pd < '02.01.2001')

this works with midas and doa.

any idea? is there a special keywords TP i shouldn't use?

regards,
ralf barth
 
The problem is probably caused by the fact that the primary key of lsv.d5160_01 does not uniquely identify a record in the result set. Since lsv.d5160_01 is the first table in the select statement, the TOracleDataSet will determine the unique fields based on the primary key of that table though.

Set the UpdatingTable property to lsv.d5160_02, or specify the UniqueFields, or set the pfInKey option of the ProviderFlags of the corresponding fields to fix the problem.

------------------
Marco Kalter
Allround Automations
 
Back
Top