Wednesday, December 25, 2013

Data structures usefull links

Tuesday, October 8, 2013

how to know the constraints on table in oracle..............

select * from user_cons_columns ucc, user_constraints uc 
where uc.constraint_name=ucc.constraint_name
and uc.constraint_type='P' and uc.table_name = 'Table Name';
R = Referential Constraint/Foreign Key constraint
C = Check Constraint
P = Primary Key
U = Unique Key

(or)

select 
   cons.owner            as child_owner, 
   cons.table_name       as child_table,
   cons.constraint_name     constaint_name,
   cons.constraint_type     constraint_type,
   col.owner                parent_owner, 
   col.table_name           parent_table,
   col.column_name          column_name
from dba_cons_columns      col, 
     dba_constraints       cons
where 
   cons.r_owner = col.owner
and 
   cons.r_constraint_name = col.constraint_name
and 
   cons.table_name = 'Table Name';
   
(or)


   select * 
from
    all_constraints 
where
    r_constraint_name in
    (select       constraint_name
    from
       all_constraints
    where
       table_name='Table Name') 

Debugging techniques in Eclipse............