I know that I can use this to create DDL create trigger;
CREATE OR REPLACE TRIGGER
create_table_trigger
AFTER CREATE ON SCHEMA
DECLARE
BEGIN
END;
Problem is this trigger would run on DDLs like 'Create sequence'; how can I only execute this for 'Create Table' DDLs?
CREATE OR REPLACE TRIGGER
create_table_trigger
AFTER CREATE ON SCHEMA
BEGIN
IF SYS.DICTIONARY_OBJ_TYPE = 'TABLE' THEN
....
END;
For a list of EVENT attributes, refer to this page
http://ist.marshall.edu/ist480adbp/plsql_triggers.html (link is down)
Wayback machine link to the contents of the dead link above: https://web.archive.org/web/20110809071133/http://ist.marshall.edu/ist480adbp/plsql_triggers.html
As far as I know, dictionary_obj_type is one of TABLE|SEQUENCE|PROCEDURE|INDEX|FUNCTION|TYPE|PACKAGE
And dictionary_obj_name is just the name of the table/sequence/proc/etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With