var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: SQL Stmt to quesry the PK
is there an sql statement wherein the result would be the
PK of the table....
please help, thanks in advance
You can use user_constraints,all_constaints or dba_constraints views
SELECT constraint_name FROM user_constraints
WHERE table_name='EMP' AND constraint_type='P'
jeny, thanks for the help....
hhhmmm, just a follow-up question, since the sql statement actually returns the constraint_name, is there a way to return the exact table_name instead... thanks again....
Type "DESC USER_CONSTRAINTS" and you'll see the full list of columns available to select...
if i perform desc user_constraints, then i would get the details of
the user_constraints, there is no available data wherein the exact
field name of the primary key would be displayed....
maybe there is a way for me to JOIN the user_constraints and the
user_tables so i can also query the exact field name side from the
thanks in advance...
thanks for all the help, i was able to find the sql statement i'm looking for
for those interested here it goes....
select a.constraint_name, a.column_name
from all_cons_columns a, all_constraints b
where a.constraint_name = b.constraint_name
and b.constraint_type = 'P'
and a.table_name = 'EMP';