2 Replies Latest reply on Feb 22, 2013 10:51 AM by David Last-Oracle

    Check Constraint

    970021
      I'm on Version 3.1.4.710.

      I imported a table using the import/ data dictionary feature. This table has a check constraint. But after importing the table, I can't find the check constraint anywhere in the model. Where can I go to change the check constraint if I wanted to. Similarly, how can I create check constraints on tables? I see a check constraint tab under Tools/ domain administration, but not sure how I can use it. Like if I create a new domain and click on check constraint, I see Types such as Oracle Database 11g, and basically I can type in something under constraint. But I'm not sure if that's the right place to place a check constraint such as in ('abc', 'dbd'). Please help.
        • 1. Re: Check Constraint
          user13430807
          Hello,

          you can add table level constraints by editing the table properties, and then select 'Table Level constraints'.
          With the + you can add a constraint (name + validation rule)

          Best regards,

          Joop
          • 2. Re: Check Constraint
            David Last-Oracle
            Hi,
            But after importing the table, I can't find the check constraint anywhere in the model.
            If the constraint only refers to a single column, it is normally imported as part of the definition of that column.
            Open the Column Properties dialog for the column (either from the Columns panel on the Table Properties dialog or from the entry for the column in the Browser tree).
            The Column Properties dialog has a "Default and Constraint" panel, which includes 3 fields: List of Values, List of Ranges and Constraint.
            You should find that one of these 3 fields contains the details of the Check Constraint; e.g. try clicking on the button for "List of Values".
            how can I create check constraints on tables?
            If the constraint only refers to a single column, you can set the List of Values, List of Ranges or Constraint fields (or a combination of these) as described above.
            Alternatively, as Joop described, you can create a "Table Level Constraint" on the Table.
            I see a check constraint tab under Tools/ domain administration, but not sure how I can use it.
            This is only relevant if you are using a domain to define your column. If the Column's datatype is defined using a Domain, and the "Use Domain Constraints" option is set for the Column (on its "Default and Constraint" panel), then the Constraints defined for the Domain (Check Constraint, Ranges and Value List) are used instead of those defined on the Column itself.

            David