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!

passing partition name in a cursor

954475Aug 8 2012 — edited Aug 8 2012
Hi All,


Need small help please. I am running below cursor but getting error like

ORA-06550: line 10, column 38:
PL/SQL: ORA-00971: missing SET keyword
ORA-06550: line 10, column 1:
PL/SQL: SQL Statement ignored

Seems it’s not able to identify R.PARTITION_NAME in update statement. Are you aware whether we can partition name like this if we need to update based on partition names in a cursor.

My cursor code is:

DECLARE
CURSOR C_PARTITION IS
SELECT PARTITION_NAME, PARTITION_POSITION FROM ALL_TAB_PARTITIONS
WHERE OWNER = 'FACTS'
AND TABLE_NAME = 'TABLEA'
ORDER BY PARTITION_NAME;
BEGIN
FOR R IN C_PARTITION
LOOP
UPDATE FACTS.TABLEA PARTITION (R.PARTITION_NAME) SB
SET SB.COL1 = SB.COL2,
SB.COL3 =
(SELECT COL4
FROM DIMS.TABLEX EX
WHERE SB.COL5 = EX.COL6) ;


COMMIT;

END LOOP;
END;

Can some body guide how to resolve it?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 5 2012
Added on Aug 8 2012
6 comments
3,427 views