To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here

HOME News MS SQL Oracle DB2 Access MySQL PHP Scripts Books Links DBA Talk


Go Back   Database Journal Forums > Related Sites > SQL Course

SQL Course SQL Course > Ask questions about the lessons on SQL Course 1 and 2. If you have problems > with the interface, please post in the Feedback forum

Reply Post New Thread
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 12-06-2002, 06:53 PM
edorne edorne is offline
Junior Member
 
Join Date: Dec 2002
Posts: 3
on update restrict

hi i am in need of some assistance for my project ASAP . I am using SQL*Plus in Oracle 8.1.7 and am trying to restrict the deletion of rows from the parent relation "players" if the playerno is in the teams table. I have tried using the "ON DELETE CASCADE " and that works fine. How come the ON DELETE RESTRICT does not work??? I have also tried to use ON DELETE NO ACTION with no luck. PLEASE HELP !!
I have attached my code below for your refrernce:

CREATE TABLE teams
(teamno INT NOT NULL,
playerno INT NOT NULL,
division VARCHAR2(10) NOT NULL,
PRIMARY KEY(teamno),
FOREIGN KEY(playerno) REFERENCES players(playerno) ON DELETE RESTRICT);
Reply With Quote
  #2  
Old 12-13-2002, 09:21 AM
edorne edorne is offline
Junior Member
 
Join Date: Dec 2002
Posts: 3
solved my own problem

by DEFAULT the "on delete restrict" option is used in Oracle. In other words if you try to delete a parent record, and the primary key of that record is accessed by the foreign key(s) of any children, the application will not allow you to delete that parent record if you do not have any constraints explicitly written . You must write something like ON DELETE CASCADE (or other referential integity constraints) if you wish to delete a parent record refernced by children records.
Reply With Quote
Reply Post New Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 07:39 AM.


DatabaseJournal Recent Articles


 » Grouping with SQL Server 2008

 » Conducting Service Broker Conversation Usi...

 » Applying data warehousing principles to ev...

 » Oracle New Year's resolutions, part 1: Adv...

 » Hands on: Understanding SQL queries

Search Database Journal:
 





Acceptable Use Policy

JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers

Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.