oracle get table key

Solutions on MaxInterview for oracle get table key by the best coders in the world

showing results for - "oracle get table key"
Gabriele
04 Nov 2019
1SELECT cols.table_name, cols.column_name, cols.position, cons.status, cons.owner
2FROM all_constraints cons, all_cons_columns cols
3WHERE cols.table_name = 'TABLE_NAME'
4AND cons.constraint_type = 'P'
5AND cons.constraint_name = cols.constraint_name
6AND cons.owner = cols.owner
7ORDER BY cols.table_name, cols.position;