by Martin <martin.j.evans@[EMAIL PROTECTED]
>
Apr 30, 2008 at 12:46 PM
On Apr 30, 7:34=A0pm, Maxim Demenko <mdeme...@[EMAIL PROTECTED]
> wrote:
> Martin schrieb:
>
>
>
> > Hi,
>
> > I have the following cut down pls/sql:
>
> > cur_entries cursorType;
>
> > IF condition
> > =A0 =A0open cur_entries for
> > =A0 =A0 =A0SELECT a from test_table1 for update of b;
> > ELSE
> > =A0 =A0open cur_entries for
> > =A0 =A0 =A0SELECT a from test_table2 for update of b;
> > END IF;
>
> > LOOP
> > =A0 FETCH cur_entries INTO var;
> > =A0 EXIT WHEN cur_entries%NOTFOUND;
>
> > =A0 IF condition
> > =A0 =A0 -- a lot of pl/sql here
> > =A0 =A0 update test_table1 set b =3D 1 where current of cur_entries;
> > =A0 ELSE
> > =A0 =A0 -- a lot of pl/sql here
> > =A0 =A0 update test_table2 set b =3D 1 where current of cur_entries;
> > =A0 END IF;
> > END LOOP;
> > and I am getting "PLS-00413: identifier in CURRENT OF clause is not a
> > cursor name".
>
> > I don't quite understand this as I thought "cur_entries" was a cursor
> > but I guess as it is defined as cursorType Oracle does not like it. Is
> > there any way for me to avoid this without replicating all the code
> > with two explicitly named cursors? All the code in the procedure is
> > identical for both cursors other than the fetch and update.
>
> > Thanks.
>
> The "current of" =A0clause does apply only to cursors, not to cursor
> varibales which you are using.
>
> Best regards
>
> Maxim
Thanks.
Do you know if it works with reference cursors? Both the tables in
question contain exactly the same columns so it would be possible for
me to create a record type of those columns.
Martin