If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > How to delete a row from Parent table without delete a row from Child table

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-11-06, 04:11
bamboat_3 bamboat_3 is offline
Registered User
 
Join Date: Jan 2006
Posts: 1
How to delete a row from Parent table without delete a row from Child table

Dear Experts,

I have created a parent table named as facility and its primary key is acting as a foreign key in LHS table including UPDATE CASCADE option.

Now, I want to delete a row from parent table without deleting a row from child table where parent table's primary key is acting as a foreign key, but whenever I try such a thing it prompt an error regarding foreign key.

I know that I have to delete a row from child table and then from parent table, but is there any way that rather to delete a row from child it just place a null value in the foreign key column through a SQL Command.

I am waiting for your suggestion and if it is possible for you then kindly send me a syntax for it.

Thank you in advance and looking forward to your reply.

Regards,
M.A.Bamboat
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On