SQL> set linesize 150
SQL> set wrap on
SQL> select OWNER, TRIGGER_NAME, TRIGGER_TYPE, TABLE_OWNER, TABLE_NAME from dba_triggers
where owner in ('SOMEUSER') order by OWNER, TRIGGER_NAME;
OWNER TRIGGER_NAME TRIGGER_TYPE TABLE_OWNER TABLE_NAME
------------------ -------------------- ---------------- ------------------ ------------------
SOMEUSER SOMETRIGGER AFTER EACH ROW SOMEUSER SOMETABLE
SOMEUSER ATRIGGER AFTER EACH ROW SOMEUSER OTHERTABLE
SOMEUSER OTHERTRIGGER AFTER EACH ROW SOMEUSER ATABLE
SOMEUSER MYTRIGGER AFTER EACH ROW SOMEUSER MYTABLE
4 rows selected.
SQL> select TABLE_OWNER, TABLE_NAME, OWNER, TRIGGER_NAME, TRIGGER_TYPE from dba_triggers
where TABLE_OWNER in ('SOMEUSER') order by TABLE_OWNER, TABLE_NAME;
TABLE_OWNER TABLE_NAME OWNER TRIGGER_NAME TRIGGER_TYPE
------------------ ------------------ ------------------ -------------------- ----------------
SOMEUSER SOMETABLE SOMEUSER TRIGGER_ONE BEFORE STATEMENT
SOMEUSER SOMETABLE SOMEUSER TRIGGER_TWO AFTER STATEMENT
SOMEUSER SOMETABLE SOMEUSER SOMETRIGGER AFTER EACH ROW
SOMEUSER OTHERTABLE SOMEUSER TRIGGER_THREE AFTER STATEMENT
4 rows selected.
SQL> set long 20000
SQL> select TRIGGER_BODY from dba_triggers where OWNER='SOMEUSER' and TRIGGER_NAME='SOMETRIGGER';
TRIGGER_BODY
--------------------------------------------------------------------------------
BEGIN
IF INSERTING THEN
log_id ('', NEW.id);
ELSE
log_id (OLD.id, NEW.id);
END IF;
END;
martes, 7 de febrero de 2012
Obteniendo información de triggers
Si quieres saber información acerca de triggers propiedad de alguien, triggers ligados a una tabla o el código de un trigger, puedes consultar la tabla dba_triggers:
Suscribirse a:
Comentarios de la entrada (Atom)
No hay comentarios.:
Publicar un comentario