DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: CONSTRAINT

Hybrid View

  1. #1
    Join Date
    May 2002
    Posts
    232
    HII,Any one can help me,
    I need check the column values by using constraint.
    Ex---ABC table
    Column name STATUS
    CHECK VALUES LIKE IF STATUS = 'A' ADMINISTRATOR
    = 'S' STAFF
    So any one can help me to write a check constraint abow column.
    thanks
    kavitha
    kavitha

  2. #2
    Join Date
    Feb 2001
    Posts
    180
    From the examples:
    CREATE TABLE Dept_tab (
    Deptno NUMBER(3) PRIMARY KEY,
    Dname VARCHAR2(15),
    Loc VARCHAR2(15),
    CONSTRAINT Dname_ukey UNIQUE (Dname, Loc),
    CONSTRAINT LOC_CHECK1
    CHECK (Loc IN ('NEW YORK', 'BOSTON', 'CHICAGO')));
    Regards
    Ben de Boer

  3. #3
    Join Date
    May 2002
    Posts
    232
    hiii,thanks
    table abc
    columnname-- status.
    status should be like this

    A-ADMINISTRATOR
    S-STAFF
    E-EXPIRED
    S-SUSPEND
    Above values should be valid by using "check" constraint.

    any one give me syntax
    thanks
    kavitha

  4. #4
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    kavithared

    why you keep on duplicating, or even tripling you threads???

    what´s the problem

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width