Link to home
Start Free TrialLog in
Avatar of hc2342uhxx3vw36x96hq
hc2342uhxx3vw36x96hqFlag for United States of America

asked on

TRIGGER WHILE DROPPING A TABLE in Oracle 10G R2

Is there any way, in Oracle 10G R2 PL/SQL, to create a TRIGGER that fires when DROPping a particular table?
ASKER CERTIFIED SOLUTION
Avatar of shru_0409
shru_0409
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of hc2342uhxx3vw36x96hq

ASKER

ORA-30506: system triggers cannot be based on tables or views
How can I fix this?
You're right shru_0409, I've substituted the SCHEMA keyword with the table name... (my error).
I would like to write a trigger that, before dropping a particular table ALPHA, drops all the remaining tables.
Any other clues?!
That trigger will be:

1) Dangerous
2) Hard to write, since it will be recursively calling itself by dropping another table (which will trigger again).

Why not just use PL/SQL or SQL to generate the drop statements on the fly?

Don't worry about hazard of that trigger, help me to write it.
>>Don't worry about hazard of that trigger, help me to write it.

Good luck.
Thanks! ;-)