I usually do them in two steps - first create table with pk fields being 
non-null

create table marathon_login (
    marathon_id NUMBER Not Null,
marathon_date_added date,
    marathon_fname VARCHAR2(100),
marathon_lname VARCHAR2(100),
marathon_email VARCHAR2(100),
marathon_type VARCHAR2(100)
)

Then...

ALTER TABLE marathon_login
 ADD CONSTRAINT pk_marathon_login PRIMARY KEY (marathon_id)

ALTER TABLE marathon_entries
 ADD CONSTRAINT fk_marathon_entries FOREIGN KEY (marathon_id)
      REFERENCES marathon_login(marathon_id)


One of the benefits of doing it this way is giving explicit names to your 
constraints. If you don't name them, Oracle will give them horrificly 
un-identifiable names. Then, if you ever want to disable them without a gui, 
you're sort of screwed.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:184288
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to