Find if a column in Oracle has a sequence

后端 未结 5 451
孤独总比滥情好
孤独总比滥情好 2021-02-05 02:56

I am attempting to figure out if a column in Oracle is populated from a sequence. My impression of how Oracle handles sequencing is that the sequence and column are separate en

5条回答
  •  鱼传尺愫
    2021-02-05 03:29

    select t.table_name,
       d.referenced_name  as sequence_name,
       d.REFERENCED_OWNER as "OWNER",
       c.COLUMN_NAME
      from user_trigger_cols t, user_dependencies d, user_tab_cols c
     where d.name = t.trigger_name
       and t.TABLE_NAME = c.TABLE_NAME
       and t.COLUMN_NAME = c.COLUMN_NAME
       and d.referenced_type = 'SEQUENCE'
       and d.type = 'TRIGGER'
    

提交回复
热议问题