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

Thread: Defining Referential Constraints

  1. #1
    Join Date
    Nov 2001
    Location
    Atlanta GA
    Posts
    45

    Cool Defining Referential Constraints

    The following is a brief overview of a coupple of queries I am using to create some tables with constraints. My questions should I switch step 4 and 5?
    -----------
    Step 1, create the employee table:
    Step 2, create the department table:

    Step 3, add the constraint to the employee table:
    alter table employee
    add (constraint empdnoFRK foreign key (dno)
    references department (dnumber));

    Step 4, enable the constraints:
    alter table employee enable constraint empsuperFRK;
    alter table department enable constraint departFRK;

    Step 5, populate the tables:

  2. #2
    Join Date
    May 2001
    Location
    Maryland, USA
    Posts
    409
    Why do you need step 4? Constraints are enabled by default.
    -- Dilip

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