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!

Alter inside a loop statement

492416Jan 26 2007 — edited Jan 26 2007
Hello, I'm trying to rebuild partitions that are unusables but I have an error when in Alter index statement..symbol not allowed.

Help you be appreciated

Thanks

Gonçalo Ribeiro
(GNR)


......................................................


v_index_name user_ind_partitions.INDEX_NAME%type;
v_partition_name user_ind_partitions.PARTITION_NAME%type;
v_tablespace_name user_ind_partitions.TABLESPACE_NAME%type;

CURSOR c1 IS select index_name, partition_name, tablespace_name
from user_ind_partitions where like '%UNUSABLE%';

...............................................
BEGIN
LOOP
FETCH c1 INTO v_index_name, v_partition_name, v_tablespace_name;

/***DEGBUG********************************/
DBMS_OUTPUT.PUT_LINE(v_index_name);
DBMS_OUTPUT.PUT_LINE(v_partition_name);
DBMS_OUTPUT.PUT_LINE(v_tablespace_name);
/*** END DEGBUG*******************************/
ALTER INDEX v_index_name REBUILD PARTITION v_partition_name
TABLESPACE v_tablespace_name;
EXIT WHEN c1%NOTFOUND;
END LOOP;
END;
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 23 2007
Added on Jan 26 2007
7 comments
494 views