when running under 11gR2 I get the following message:
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 ;
Restrictions on the FOR UPDATE Clause:Perhaps you should have checked the fine 11g Oracle® Database SQL Language Reference.
This clause is subject to the following restrictions:
You cannot specify this clause with the following other constructs: the DISTINCT operator, CURSOR expression, set operators, group_by_clause,
or aggregate > functions.
The tables locked by this clause must all be located on the same database and on the same database as any LONG columns and sequences
referenced in the same statement.
damorgan wrote:What he posted did not have a cursor loop. He posted a cursor definition. There's no reason the cursor in his post could not be used with bulk collect and forall.
Cursor loops of the type you have posted have been obsolete for more than a decade.
Look into replacing what you've written with BULK COLLECT and FORALL statements.