Hi everybody,
when using Toad to convert a query featuring outer joins written in the old Oracle notation into ANSI notation, I’ve run into a problem:
If I write it like this:
select AGENTS.AG_AGCLE, AGENTS.AG_NOM, S01_SERVICES.SE_CODE, S01_DEPART.DP_CODE, S01_DEPART.DP_NOM, CONGES.CG_CPANT, S01_PERSO.PE_TEMPSW, MEDWORK.MK_VILLE, MEDWORK.MK_DOCTORNAME
from S01_PERSO,S01_SERVICES,S01_DEPART,AGENTS,CONGES,MEDWORK
where SE_DPCLE=DP_DPCLE
and SE_SECLE=PE_SECLE
and PE_AGCLE=AG_AGCLE
and AG_AGCLE=CG_AGCLE(+)
and AG_MKCLE=MK_MKCLE(+)
and PE_PECLE=25;
Toad converts it to this, which is correct:
SELECT AG_AGCLE, AG_NOM, SE_CODE, DP_CODE, DP_NOM, CG_CPANT, PE_TEMPSW, MK_VILLE, MK_DOCTORNAME
FROM S01_PERSO
INNER JOIN AGENTS ON (PE_AGCLE = AG_AGCLE)
INNER JOIN S01_SERVICES ON (SE_SECLE = PE_SECLE)
INNER JOIN S01_DEPART ON (SE_DPCLE = DP_DPCLE)
LEFT OUTER JOIN CONGES ON (AG_AGCLE = CG_AGCLE)
LEFT OUTER JOIN MEDWORK ON (AG_MKCLE = MK_MKCLE)
WHERE PE_PECLE = 25;
Whereas if I write it like this, which is the same query (I just wrote one of the join conditions the other way round):
select AGENTS.AG_AGCLE, AGENTS.AG_NOM, S01_SERVICES.SE_CODE, S01_DEPART.DP_CODE, S01_DEPART.DP_NOM, CONGES.CG_CPANT, S01_PERSO.PE_TEMPSW, MEDWORK.MK_VILLE, MEDWORK.MK_DOCTORNAME
from S01_PERSO,S01_SERVICES,S01_DEPART,AGENTS,CONGES,MEDWORK
where SE_DPCLE=DP_DPCLE
and SE_SECLE=PE_SECLE
and PE_AGCLE=AG_AGCLE
and CG_AGCLE(+)=AG_AGCLE
and AG_MKCLE=MK_MKCLE(+)
and PE_PECLE=25;
Toad converts it to this, which is wrong!
SELECT AG_AGCLE, AG_NOM, SE_CODE, DP_CODE, DP_NOM, CG_CPANT, PE_TEMPSW, MK_VILLE, MK_DOCTORNAME
FROM S01_PERSO
INNER JOIN AGENTS ON (PE_AGCLE = AG_AGCLE)
INNER JOIN S01_SERVICES ON (SE_SECLE = PE_SECLE)
INNER JOIN S01_DEPART ON (SE_DPCLE = DP_DPCLE)
LEFT OUTER JOIN MEDWORK ON (AG_MKCLE = MK_MKCLE)
RIGHT OUTER JOIN CONGES ON (CG_AGCLE = AG_AGCLE)
WHERE PE_PECLE = 25;
I have searched online for this problem and found nothing, Has anybody else come across this? Is this a bug, or am I missing something? If it is a bug, how come a product as mature as Toad can still have bugs this serious?
I’m using Toad for Oracle Freeware 12.10.0.30, 64 bit on Windows 7 64 bit.
Thanks in advance.
Andy