Join user_constraints and user_cons_columns table : USER_CONSTRAINTS « System Tables Views « Oracle PL / SQL






Join user_constraints and user_cons_columns table

   
SQL>
SQL> SELECT dc.table_name, dcc.column_name, dcc.position,
  2         dcc.constraint_name, dc.constraint_type, dc.search_condition
  3  FROM   user_constraints dc, user_cons_columns dcc
  4  WHERE  dcc.table_name      = dc.table_name
  5  AND    dcc.owner           = dc.owner
  6  AND    dcc.constraint_name = dc.constraint_name
  7  and    rownum < 50
  8  ORDER BY dcc.table_name, dcc.owner, dcc.position, dcc.column_name;

no rows selected

   
    
  








Related examples in the same category

1.Get a list of constraints defined on the employee table from User_Constraints
2.Query user_constraints for constriant name, type, table name
3.Output user constraints in details