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).

Was it helpful?

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top