How to find primary Key of a Oracle Table

Friday, November 1, 2013

How to find primary Key of a Oracle Table

How to find primary Key of a Oracle Table

SELECT   cols.table_name, cols.column_name, cols.POSITION, cons.status,          cons.owner
    FROM all_constraints cons, all_cons_columns cols
   WHERE upper(cols.table_name) = UPPER ('TABLE_NAME')      AND cons.constraint_type = 'P'
     AND cons.constraint_name = cols.constraint_name
     AND cons.owner = cols.owner
ORDER BY cols.table_name, cols.POSITION;

Error 404

The page you were looking for, could not be found. You may have typed the address incorrectly or you may have used an outdated link.

Go to Homepage