Home » SQL & PL/SQL » SQL & PL/SQL » prevent drop of table
prevent drop of table [message #21425] Fri, 02 August 2002 05:45 Go to next message
Susan
Messages: 102
Registered: October 2001
Senior Member
Does anyone know of a way to prevent the drop of a table by all, including the owner? I know I could set up a referential integrity that would throw an error upon dropping, but, I'm wondering if there is another way. Thanks.
Re: prevent drop of table [message #21434 is a reply to message #21425] Fri, 02 August 2002 10:20 Go to previous messageGo to next message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
If you are on 8i or later, you can use a DDL trigger:

http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:385418740519
Re: prevent drop of table [message #21437 is a reply to message #21425] Fri, 02 August 2002 12:04 Go to previous messageGo to next message
Susan
Messages: 102
Registered: October 2001
Senior Member
thanks Todd -- I looked at Tom's code - this seems to apply across the whole database. Can you have a before drop trigger on a specific schema instead of the whole database? Thanks.
Re: prevent drop of table [message #21479 is a reply to message #21425] Wed, 07 August 2002 01:04 Go to previous messageGo to next message
abdul
Messages: 18
Registered: May 2001
Junior Member
How to delete particular Attribute(column) in one Table
say example empno, empname
i need to delete empno

how
please send the details
Re: prevent drop of table [message #21484 is a reply to message #21425] Wed, 07 August 2002 05:50 Go to previous message
Susan
Messages: 102
Registered: October 2001
Senior Member
As of 8i you can drop a column from a table.
you can drop a column immediately or you can mark it "unused" to be dropped later

Alter table emp drop column empno;
alter table emp set unused column empno;

marking a column as unused does not release the space previously used by the column until you drop the unused columns

alter table emp drop unused columns;

once you have marked a column as "unused" you cannot access that column
Previous Topic: Re: Sequence Problem Very Urgent
Next Topic: Import and export tables resets sequences. Why?
Goto Forum:
  


Current Time: Wed Apr 24 12:00:17 CDT 2024