problem on oracleDataset using union

Angelo

Member
I use an oracleDataset component in an application (Doa 3.4.5 and oracle 9i), with this sql:

sql for oracleDataSet:

select '0' as NumRow,
lab_tipoprova.idtipoprova,
lab_tiposprova.idtiposprova,
0 as idDenpart,
0 as checkFld,
null as flgtest,
lab_tipoprova.destipoprova,
lab_tiposprova.destiposprova
from lab_tipoprova,
lab_tiposprova
where lab_tipoprova.idtipoprova = lab_tiposprova.idtipoprova (+)
and lab_Tiposprova.Idtiposprova not in (select lab_tiprvdenpart.idtiposprova from lab_tiprvdenpart
where lab_tiprvdenpart.iddenpart = :iddenpart and
(lab_tiprvdenpart.idtipoprova = lab_tipoprova.idtipoprova
or lab_tiprvdenpart.idtiposprova = ''))

union

select ROWIDTOCHAR(lab_TiprvDenPart.rowid) as numRow,
lab_tiprvdenpart.idtipoprova,
lab_tiprvdenpart.idtiposprova,
Lab_tiprvdenpart.iddenpart,
1 as checkFld,
lab_tiprvdenpart.flgtest,
Lab_tipoprova.Destipoprova,
lab_tiposprova.destiposprova
from lab_tiprvdenpart, lab_tipoprova, lab_tiposprova
where lab_tiprvdenpart.iddenpart = :iddenpart
and lab_tiprvdenpart.idtipoprova = lab_tipoprova.idtipoprova
and lab_tiprvdenpart.idtiposprova = lab_tiposprova.idtiposprova (+).

When I read the dataset, I dont reach records from the second select (after union),
and dataset never detects eof.
(the next method on last row of first select, move cursor at top)

Thanks. Angelo
 
The "Next" method should never place the cursor to the top of the result set. Are you sure this is the case? You can verify this by checking the RecNo property of the dataset.

Perhaps the first select statement returns duplicate rows because of an incomplete join condition?

------------------
Marco Kalter
Allround Automations
 
Originally posted by mkalter:
The "Next" method should never place the cursor to the top of the result set. Are you sure this is the case? You can verify this by checking the RecNo property of the dataset.

Perhaps the first select statement returns duplicate rows because of an incomplete join condition?


Pleasse excuse me for the question, I discovered that was a my application problem, thanks for you aid. Angelo
 
Back
Top