[ACCEPTED]-Creating a trigger to only run when a new table is being created-ddl
Accepted answer
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 6 this page
http://ist.marshall.edu/ist480adbp/plsql_triggers.html (link is down)
Wayback machine 5 link to the contents of the dead link above: https://web.archive.org/web/20110809071133/http://ist.marshall.edu/ist480adbp/plsql_triggers.html
As 4 far as I know, dictionary_obj_type is one 3 of TABLE|SEQUENCE|PROCEDURE|INDEX|FUNCTION|TYPE|PACKAGE
And 2 dictionary_obj_name is just the name of 1 the table/sequence/proc/etc.
- dictionary_obj_type Returns the type of the dictionary object on which the DDL operation that fired the trigger occurred.
- dictionary_obj_name Returns the name of the dictionary object on which the DDL operation that fired the trigger occurred.
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.