I have a requirement where I need to run a update script over multiple partitions of a table . I have written a script for it as below:
but it gives
ORA-14108: illegal partition-extended table name syntax
Cause: Partition to be accessed may only be specified using its name. User attempted to use a partition number or a bind variable.
Action: Modify statement to refer to a partition using its name
Any idea how can I circumvent this error?
DECLARE
TYPE partition_names IS varray(1) OF varchar2(20);
curr_partition partition_names;
LENGTH integer;
BEGIN
curr_partition :=partition_names('SM_20090731');
LENGTH := curr_partition.count;
FOR i IN 1 .. LENGTH LOOP
dbms_output.put_line('Current Partition name is: '||curr_partition(i));
UPDATE TABLE_Y PARTITION (curr_partition(i))
SET PARTITION_KEY=TO_DATE('2017-08-21','YYYY-MM-DD')
WHERE ORDER_ID IN
(SELECT ORDER_ID
FROM TABLE_X);
END LOOP;
END;
/