Category Archives: Oracle

Finding Primary Keys in Oracle

A Query i use from time to time to find out which primary key columns are defined for a certain table: SELECT cols.table_name, cols.column_name, cols.position, cons.status, cons.owner FROM all_constraints cons, all_cons_columns cols WHERE cols.table_name = ‘_TABLE-NAME_’ AND cons.constraint_type = ‘P’ … Continue reading

Posted in Database, Oracle | Tagged , , | Leave a comment