I have a sp with cursor and FOR IN (SELECT) loop, it compilled fine untill I put join into SELECT statement so I'm geting this now:
PLS-00402: alias required in SELECT list of cursor to avoid duplicate column names
I triple checked that my SELECT is working fine from Query window, is there any special rules for < FOR IN ( SELECT)>
it's actually from View if it's matter to colect contra side information for given transaction
FOR i IN (
select t1.IDCUST, t1.AMOUNT, t1.CELL,
t1.SHIPCUST, t1.PRODID,
t2.SHIPCUST, t2.PRODID,
from RYBA.VIEW_TANG t1
inner join RYBA.VIEW_TANG t2 on t2.IDCUST = t1.IDCUST
where t1.SIDE != t2.side
)
LOOP
....
This error points to the line with <FOR in IN>:
PLS-00402: alias required in SELECT list of cursor to avoid duplicate column names
I see that it doesn't like t1.shipcust and t2.shipcust at the same time, like it doen't recognize my prefixes t1, t2, it's easy fix but why it so?
without t2. columns it compiles OK.
APpreciate you help on this easy for someboy matter.
Tx
Trento