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

質問

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

役に立ちましたか?

解決

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.

ライセンス: CC-BY-SA帰属
所属していません dba.stackexchange
scroll top