-
Notifications
You must be signed in to change notification settings - Fork 335
Expand file tree
/
Copy pathcons2.sql
More file actions
31 lines (28 loc) · 713 Bytes
/
cons2.sql
File metadata and controls
31 lines (28 loc) · 713 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
-- Copyright 2018 Tanel Poder. All rights reserved. More info at http://tanelpoder.com
-- Licensed under the Apache License, Version 2.0. See LICENSE.txt for terms & conditions.
column cons_column_name heading COLUMN_NAME format a30
column R_CONSTRAINT_NAME for a30
column CONSTRAINT_NAME for a30
select
co.owner,
co.table_name,
co.constraint_name,
co.constraint_type,
cc.column_name cons_column_name,
cc.position
from
dba_constraints co,
dba_cons_columns cc
where
co.owner = cc.owner
and co.table_name = cc.table_name
and co.constraint_name = cc.constraint_name
and lower(co.table_name) like lower('&1')
order by
owner,
table_name,
constraint_type,
column_name,
constraint_name,
position
/