Reputation: 1058
How do you get a list of all identity columns in Oracle SQL?
Upvotes: 0
Views: 5496
Reputation: 16001
Query USER|ALL|DBA|CDB_TAB_IDENTITY_COLS for technical details about the identity settings.
Query USER|ALL|DBA|CDB_TAB_COLUMNS where IDENTITY_COLUMN = 'YES'
as suggested in Prasanth's answer for general information about the columns.
Upvotes: 2
Reputation: 28
There are no identity columns in Oracle as in SQL server. There is a concept of Primary Key in Oracle. You can find list of primary keys for all tables in DB using below query:
SELECT a.table_name,a.column_name
FROM all_cons_columns a, all_constraints b
where a.constraint_name = b.constraint_name
and b.constraint_type = 'P';
Hope this helps:)
Upvotes: -4
Reputation: 1058
SELECT table_name, column_name FROM all_tab_columns WHERE identity_column = 'YES';
Upvotes: 3