4 Replies Latest reply: Aug 4, 2013 1:27 AM by 979801 RSS

    Check Constraint

    979801

      Hello experts,

                           I am new in oracle using sql developer in windows 7.I have a problem in which I have to  make two tables first:

      Tbl_State(S_Id,S_Name,Country_Id)

      and

      tbl_City(C_Id,,C_Name,State_Id)

      .

      I have  to add a constraint to table tbl_city so that it could accept values for State_Id column only which are exist in S_Id column in tbl_state.For this I have tried to add a sub query in check constraint to mach the values from tbl_state.S_Id but I think Oracle sql does not allow sub query in check constraint.Give me suggestion  that how can  I solve this Problem.

      thnak You

      regrads

      aditya