表制約表示用sql



rem --------------------------------------------------
rem  表制約表示SQL
rem   Usage: @showcons テーブル名
rem --------------------------------------------------

set linesize 100
set pagesize 30

col constraint_name format A20
col table_name format A20
col constraint_type format A4
col column_name format A20

select t.table_name, t.constraint_name, t.constraint_type, t.status, c.column_name, c.position
from sys.all_constraints t, sys.all_cons_columns c
where t.table_name = '&1'
and t.owner=c.owner
and t.constraint_name=c.constraint_name
and t.table_name=c.table_name
order by t.table_name, t.constraint_name, c.position
/

2001/03/21 山野辺

[目次へ]