Home » SQL & PL/SQL » SQL & PL/SQL » Drop ... Cascade Constraints (10g RHEL5)
Drop ... Cascade Constraints [message #343505] Wed, 27 August 2008 07:50 Go to next message
marcossantos
Messages: 123
Registered: June 2008
Senior Member
Hi,

I need drop some tables of the schema in database.

There are dependencies in this tables. There area tables of other schemas referring this table.

I need to keep this dependencies and recreate this table;

How can I do?

Marcos Santos

Re: Drop ... Cascade Constraints [message #343510 is a reply to message #343505] Wed, 27 August 2008 07:55 Go to previous messageGo to next message
tyler_durden
Messages: 14
Registered: August 2008
Location: http://tinyurl.com/63fmwx
Junior Member
Quote:

I need to keep this dependencies and recreate this table;



You cannot. If you want to recreate the parent table, then you will have to:

- drop the foreign key constraint(s)
- drop the parent table
- create the parent table
- create the foreign key constraint(s)

HTH
tyler_durden

Re: Drop ... Cascade Constraints [message #343513 is a reply to message #343505] Wed, 27 August 2008 07:58 Go to previous messageGo to next message
nagarajumail
Messages: 1
Registered: November 2007
Junior Member


Mad

firs u find out which table containing primay key.
You can use this query remove the primary relationship

alter table table_name drop primary key


regards
Re: Drop ... Cascade Constraints [message #343518 is a reply to message #343505] Wed, 27 August 2008 08:10 Go to previous messageGo to next message
marcossantos
Messages: 123
Registered: June 2008
Senior Member
Hi,

thanks for your answers.
So, I need to recreate all dependencies.

regards,


Marcos
Re: Drop ... Cascade Constraints [message #343547 is a reply to message #343518] Wed, 27 August 2008 08:52 Go to previous message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Quote:
So, I need to recreate all dependencies.

Yes.

Regards
Michel
Previous Topic: Dynamic Schema Access...A better way?
Next Topic: ORA-01410: invalid ROWID
Goto Forum:
  


Current Time: Fri Dec 06 23:00:58 CST 2024