On Delete Cascade/Set Null
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: On Delete Cascade/Set Null

  1. #1
    Join Date
    Aug 2001
    Posts
    134
    Examples of On Delete Cascade/Set Null .

  2. #2
    Join Date
    Feb 2001
    Posts
    180
    Nice example
    Regards
    Ben de Boer

  3. #3
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    4,001
    I think that you need to do a set null with trigger based ri.

  4. #4
    Join Date
    Aug 2001
    Posts
    134

    Talking bensr Nice example

    The following examples of CREATE TABLE statements show the definition of several integrity constraints:

    CREATE TABLE Dept_tab (
    Deptno NUMBER(3) CONSTRAINT Dept_pkey PRIMARY KEY,
    Dname VARCHAR2(15),
    Loc VARCHAR2(15),
    CONSTRAINT Dname_ukey UNIQUE (Dname, Loc),
    CONSTRAINT Loc_check1
    CHECK (loc IN ('NEW YORK', 'BOSTON', 'CHICAGO')));

    CREATE TABLE Emp_tab (
    Empno NUMBER(5) CONSTRAINT Emp_pkey PRIMARY KEY,
    Ename VARCHAR2(15) NOT NULL,
    Job VARCHAR2(10),
    Mgr NUMBER(5) CONSTRAINT Mgr_fkey
    REFERENCES Emp_tab,
    Hiredate DATE,
    Sal NUMBER(7,2),
    Comm NUMBER(5,2),
    Deptno NUMBER(3) NOT NULL
    CONSTRAINT dept_fkey REFERENCES Dept_tab ON DELETE CASCADE);



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