Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: drop foreign key

Re: drop foreign key

From: Tom Dyess <hiddenfromspam_at_spam.com>
Date: Mon, 10 Mar 2003 18:44:50 -0500
Message-ID: <hk9ba.6338$aQ.3723@fe06.atl2.webusenet.com>


Search google for DBMS_SQL.PARSE

"oracle1" <santyspamsharma_at_hotmail.com> wrote in message news:b4j1b3$20rnjl$1_at_ID-84096.news.dfncis.de...
> Currently I am using following sql for dropping a foreign key on table
> TESTCHILD column id. Constraint name is system generated , so I can't drop
> it simply by using drop constraint clause without selecting it first from
> dictionary. Is there any other way to do it? I am using 8.1.7 and 9.1
>
> Thanks
> santysharma
>
>
> declare
> cons_name varchar2(100);
> drop_string varchar2(200);
> begin
> select constraint_name into cons_name
> from user_constraints where
> table_name = 'TESTCHILD' and constraint_type ='R';
> drop_string := 'ALTER TABLE TESTCHILD DROP CONSTRAINT '||cons_name;
> execute immediate(drop_string);
> end;
>
>
Received on Mon Mar 10 2003 - 17:44:50 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US