Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Drop constraint in PL@SQL
All,
Could someone tell me why the code following doesn't work ?
It is not possible to drop a table in a PL_at_SQL Loop ?
Any help would be appreciated,Tx !
DECLARE
cursor C1 IS SELECT TABLE_NAME, CONSTRAINT_NAME FROM USER_CONSTRAINTS;
v_table_name USER_CONSTRAINTS.TABLE_NAME%type;
v_constraint_name USER_CONSTRAINTS.CONSTRAINT_NAME%type;
BEGIN
OPEN C1;
LOOP
FETCH C1 INTO v_table_name, v_constraint_name;
EXIT WHEN (C1%NOTFOUND);
ALTER TABLE v_table_name DROP CONSTRAINT v_constraint_name;
END LOOP;
CLOSE C1;
END;
Received on Wed Nov 05 2003 - 12:29:11 CST