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