紧急:查询某个用户下,表上建有触发器的表名(所有表名)

lei_r 2011-05-02 11:36:41
期待解决: 本人新手。 谢谢!!! 补充:某个用户下: 只要表上建立有触发器的, 都查询出来,查询结果(表名)

...全文
101 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
yejihui9527 2011-05-03
  • 打赏
  • 举报
回复
select distinct table_name
from user_triggers where table_owner=upper('用户名');
xiaoyaobihai 2011-05-03
  • 打赏
  • 举报
回复
select * From user_triggers
304的的哥 2011-05-03
  • 打赏
  • 举报
回复

--视图的信息都存储在数据字典视图user_trigger里面:
desc user_triggers;
Name Type Nullable Default Comments
----------------- -------------- -------- ------- ---------------------------------------------------------------------------
TRIGGER_NAME VARCHAR2(30) Y Name of the trigger
TRIGGER_TYPE VARCHAR2(16) Y Type of the trigger (when it fires) - BEFORE/AFTER and STATEMENT/ROW
TRIGGERING_EVENT VARCHAR2(227) Y Statement that will fire the trigger - INSERT, UPDATE and/or DELETE
TABLE_OWNER VARCHAR2(30) Y Owner of the table that this trigger is associated with
BASE_OBJECT_TYPE VARCHAR2(16) Y
TABLE_NAME VARCHAR2(30) Y Name of the table that this trigger is associated with
COLUMN_NAME VARCHAR2(4000) Y The name of the column on which the trigger is defined over
REFERENCING_NAMES VARCHAR2(128) Y Names used for referencing to OLD, NEW and PARENT values within the trigger
WHEN_CLAUSE VARCHAR2(4000) Y WHEN clause must evaluate to true in order for triggering body to execute
STATUS VARCHAR2(8) Y If DISABLED then trigger will not fire
DESCRIPTION VARCHAR2(4000) Y Trigger description, useful for re-creating trigger creation statement
ACTION_TYPE VARCHAR2(11) Y
TRIGGER_BODY LONG Y Action taken by this trigger when it fires
--
select table_owner,table_name,column_name,trigger_name,triggering_event
from user_triggers;

其他数据库对象的定义代码,可以从user_source视图里面找到:

oracle 定义对象的代码可以从user_source数据字典中找到

17,377

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 基础和管理
社区管理员
  • 基础和管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧