"ORA-01417: a table may be extra joined to at most one other table"

0

I'm setting a select and I came across the following error:

  

ORA-01417: a table may be extra joined to most other table

SELECT A.SEQPESSOA, A.NUMERONF, A.NROEMPRESA, A.SEQPRODUTO, D.SEQCONTRATO, E.PERCDESCONTO, D.SEQCONTRATO, E.SEQCONTRATODESCONTO, G.SEQIDENTIFICADOR
FROM MLF_NFITEM A, MLF_NOTAFISCAL B, GE_REDEPESSOA C, MGC_CONTRATO D, MGC_CONTRATODESCONTO E, MAP_PRODUTO F, MGC_CONTRATOFAMILIA G
WHERE A.SEQAUXNOTAFISCAL = B.SEQAUXNOTAFISCAL
AND B.SEQPESSOA = C.SEQPESSOA
AND C.SEQREDE = D.SEQREDE
AND D.SEQCONTRATO = E.SEQCONTRATO
AND F.SEQPRODUTO = A.SEQPRODUTO
AND F.SEQFAMILIA = G.SEQFAMILIA(+)
AND E.SEQCONTRATODESCONTO = G.SEQIDENTIFICADOR(+)

I know you are giving this error because I put the (+) in two fields of table G. I know this because if I remove one of these (+) the select works.

But I really need to make these two associations:

AND F.SEQFAMILIA = G.SEQFAMILIA(+)  
AND E.SEQCONTRATODESCONTO = G.SEQIDENTIFICADOR(+)   

And I really do need select to bring me the records from the right table even though it does not exist in the left table, but if I put only one (+) on one of the rows, select does not bring me all the records I want, so I really need to figure out how to put the (+) in the two lines.

How can I do this?

    
asked by anonymous 26.06.2017 / 23:17

1 answer

0

try the following,

    AND F.SEQFAMILIA (+)= G.SEQFAMILIA
AND E.SEQCONTRATODESCONTO (+) = G.SEQIDENTIFICADOR

Basically, the (+) sign in the oracle represents the side of a relationship that is optional, used to mount a left join or right join. The way your query was, you were bringing it back using the relationship.

    
11.07.2017 / 02:44