Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

FORALL and UPDATE

439500Mar 3 2005 — edited Mar 3 2005
Hi,

I've a problem with forall and update. I try execute the following example (PL/SQL User's Guide and Reference
Release 2 (9.2)
Part Number A96624-01)

CREATE TABLE coords (x NUMBER, y NUMBER);
CREATE TYPE Pair AS OBJECT (m NUMBER, n NUMBER);
DECLARE
TYPE PairTab IS TABLE OF Pair;
pairs PairTab := PairTab(Pair(1,2), Pair(3,4), Pair(5,6));
TYPE NumTab IS TABLE OF NUMBER;
nums NumTab := NumTab(1, 2, 3);
BEGIN
/* The following statement succeeds. */
FORALL i in 1..3
UPDATE coords SET (x, y) = (pairs(i).m, pairs(i).n)
WHERE x = nums(i);
END;

but this example fails!!
I've try to modify the example in this way


DECLARE
TYPE PairTab IS TABLE OF Pair;
pairs PairTab := PairTab(Pair(1,2), Pair(3,4), Pair(5,6));
TYPE NumTab IS TABLE OF NUMBER;
nums NumTab := NumTab(1, 2, 3);
BEGIN
/* The following statement succeeds. */
FORALL i in 1..3
UPDATE coords SET x = pairs(i).m,
y = pairs(i).n
WHERE x = nums(i);
END;

but it fails for this reason
PLS-00436: implementation restriction: cannot reference fields of BULK In-BIND table of records

why this error?


anna

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 31 2005
Added on Mar 3 2005
3 comments
294 views