This discussion is archived
8 Replies Latest reply: May 10, 2012 12:30 PM by kendenny RSS

using cursor for update release 11gR2-problem

48665 Newbie
Currently Being Moderated
Hi experts,

a peace of source working without any problems under Oracle 9i, 10g is not functional under 11gR2
( OS is Windows7, 64 bit, Oracle 11gR2 64 bit installed) :
declare cursor c1(l_id in number) is
select   k.aukonto_id
         , nvl(kab.kontoabschluss_id, 0) as abs_id
         , k.saldo, nvl(kab.saldo, 0) as anf_saldo
         , k.waehrung_code
         , kab.ka_datum as datum
         , fau.is_ertraegnis_gew as is_ftyp 
from             a_unterkonto         k 
        left join aukonto_abschluss kab 
               on       k.aukonto_id = kab.aukonto_id 
                   and kab.status = -1 
        left join read_finanz_aukonten_vw fau 
               on k.aukonto_id = fau.aukonto_id 
where       k.akonto_id = l_id 
          and (    kab.ka_datum =  
                                             ( select max(aua.ka_datum) from aukonto_abschluss aua
                                               where aua.aukonto_id = k.aukonto_id )    
                  or kab.ka_datum is null      
              for update of k.saldo
when running under 11gR2 I get the following message:
ORA-00918 column ambiguously defined
which is not true. If I remove "for update of k.saldo" phrase, I get no error.
Under 9i and 10 it works as designed.

Any help is appreciated


  • Correct Answers - 10 points
  • Helpful Answers - 5 points