This content has been marked as final. Show 8 replies
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.
This must be a bug...
A quick search on metalink revealed this:
Bug:9378712 RDBMS: Select statement with "For Update Of" clause may fail with ORA-918.
Said to be fixed in 18.104.22.168
You are on 22.214.171.124?
thanks for your help.
As I know, same restrictions are valid for former releases. They do not really match my problem because the cursor will walk each line without going thru any duplicate problem. The update field is not ambigous. Software runs well in Releases 9i and 10g.
The next reply pointed out to be a bug which was fixed in release 11.2.2. In fact I use 11.2.1. So I try upgrading.
Nevertheless many thanks for your effort.
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.