How can I create a trigger that prevents column delete, data deletion and table truncate in the same time?

dba.stackexchange https://dba.stackexchange.com/questions/205406

Question

Having written this trigger create:

CREATE OR REPLACE TRIGGER PROTECT_DB BEFORE DROP OR TRUNCATE ON X.SCHEMA

How can I "add" a DELETE in the trigger definition ? (the DELETE should prevent data deleting from tables and column erasing).

Était-ce utile?

La solution

You can't. Look at the docs. In the syntax diagrams note, that there is no way from the ddl_event/OR loop to get to dml_event_clause.

And it wouldn't make any sense either. On what table should that trigger fire? DDL trigger don't have tables as targets.

Use two separate triggers.

Licencié sous: CC-BY-SA avec attribution
Non affilié à dba.stackexchange
scroll top