How to temporarily disable on delete cascade but not the constraint

Hi all
i would like to know if this is possible
how to temporarily disable on delete cascade but not the constraint
i want to delete a row from the primary key table but i dont want the data from the foreign key to be deleted even though there is an on delete cascade set.
how do i temporarily disable on delete cascade from firing without disabling the constraint
Rgrds

There is an option which I've never used before but just read about which is to create your foreign key constraint as on delete SET NULL
instead of on delete cascade.
This will allow you to delete a parent and will set the foreign key column values in the child table to nulls
e.g.
SQL> create table parent (father varchar2(30) primary key,
  2                       age number);
Table created.
SQL>
SQL> create table child (father varchar2(30) constraint fk references parent(father) on delete set null,
  2                      child varchar2(30),
  3                      age number);
Table created.
SQL>                    
SQL> insert into parent values ('JOHN', 34);
1 row created.
SQL> insert into child values ('JOHN', 'SARAH', 10);
1 row created.
SQL> insert into child values ('JOHN', 'BILL', 12);                   
1 row created.
SQL>
SQL> commit;
Commit complete.
SQL>
SQL> delete from parent where father = 'JOHN';
1 row deleted.
SQL>
SQL> select * from child;
FATHER                         CHILD                                 AGE
                               SARAH                                  10
                               BILL                                   12
SQL> HTH AMM

Similar Messages

  • How to get servername from a request but not the cluster name?

    hi all,
    how do i get server name from the request? This is the scenario, When ever a request is made, its handed to a cluster and then directed to one of the server in the cluster.
    When i say request.getServerName();---- This is giving me the cluster name and not the server name.
    any suggestions/idea ? Thanks alot in advance.
    Edited by: new_member on Apr 18, 2008 9:11 PM

    ADJavaUser wrote:
    You could try this:
    Create a batch or shell script that executes ifconfig or ipconfig and writes the IP address out to a file.
    Place each shell script file at different locations on each server within the cluster.
    Then within the code, try to execute each script from an external process (Runtime.exec). Since the files are at different locations within each server only the correct shell script for each server should execute and write the IP Address to a file. You'll have to detect which one ran. Then open the file that was written, possible parse it for the IP Address and use the code that I already provided.
    This is a time consuming process that will slow your application. Additionally depending on how your cluster is set up it might not work and still return the cluster's IP address.I got the solution....java.net.InetAddress.getLocalHost().getHostName(); works fine...But thanks guyz for ur responses

  • Re: how to get servername from a request but not the cluster name?

    hi all,
    how do i get server name from the request? This is the scenario, When ever a request is made, its handed to a cluster and then directed to one of the server in the cluster.
    When i say request.getServerName();---- This is giving me the cluster name and not the server name. Say cluster1 has server1 and server2 and request is dispatched to any of one these servers. request.getServerName() - gives me cluster1 but I need to get server1/server2.
    any suggestions/idea ? Thanks alot in advance.

    http://forum.java.sun.com/thread.jspa?threadID=5287623

  • RAW+JPEG Pairs: How do I delete one, but not the other?

    I import RAW+JPEG. How can I ditch just the JPEG or just the RAW half of the pair? A3 seems to allow display of only one or the other by making it the Master, but how do I get rid of the non-Master?

    There's an easier way:
    Open the Aperture library contents (ctrl-click, select "show pkg contents"), and navigate to masters/year/month/day/downloads, and delete the raw file(s).
    You can view by kind, and delete all the raw files in a project this way; just make sure you haven't assigned any of the raw files as master.
    So far, I have not observed any adverse effects to the Aperture database, but they may be coming. I always archive all the files off-line before importing to Aperture, no nothing is completely irreversible.
    It would still be nice, as another poster said somewhere, to render a raw file as a new jpg master, and then delete the raw, but I use raws so rarely, that deleting the ones I don't use gives me 90% of the disk savings.

  • How can i delete my icloud account but not the password to turn off the find my phone

    how can i delete my icloud account but not the password to turn off the find my phone setting

    Make sure you are signed into iMessage and FaceTime with your current ID.  If they are signed into the old ID, go to Settings>Messages>Send & Receive and Settings>FaceTime, tap the ID, sign out, then sign back in with your current ID.
    Then temporarily recreate the old ID by going to https://appleid.apple.com, click Manage my Apple ID and sign in with your current iCloud ID.  Click edit next to the primary email account, change it back to your old email address and save the change.  (You should not have to verify the old email account so it doesn’t matter if you no longer have access to it.)  Now go to Settings>iCloud, turn off Find My iPad and enter your current password when prompted (even though it prompts you for the password for your old ID).  Then save any photo stream photos that you wish to keep to your camera roll (unless using iCloud Photo Library).  When finished go to Settings>iCloud, tap Sign Out and choose Delete from My iPad when prompted (your iCloud data will still be in iCloud).  Next, go back to https://appleid.apple.com and change your primary email address back to the way it was.  Now you can go to Settings>iCloud and sign back in with your current iCloud ID and password (your data will download back to your device).

  • How can I disable making live shape rectangle in the first place but normal one instead in Illustrator CC?

    How can I disable making live shape rectangle in the first place but normal one instead in Illustrator CC? When I create rectangle I can't transform it by dragging and it's only the problem with rectangle, not with circle, star etc. I try show/hide edges/bounding box reset preferences and reinstall whole illustrator CC and it's the same. I can only make this right by expand this rectangle, which is shape as is turn out to rectangle by clicking object>shape>expand rectangle. But this is so frustrating. Help!:) oh, and I use OSX. My friend has the same specs and it's works. I mean she can use live shape corner transformations and changing size by draging:(

    I’ve created my own plugin (available for free for personal and commercial use) which imitates behavior of the ‘old’ Rectangle Tool. It doesn’t replace the Live Rectangle – it works completely independent!
    My Plain Rectangle Tool correctly snaps to grids/objects/points and correctly aligns to grid/points on resize. Of course it supports the SHIFT and ALT/OPTION keys, Snap to Grid and Smart Guides options. In other words it works almost 100% the same as the Rectangle Tool we know from CC (17.1), CS6 and earlier.
    The installation package (zxp) adds ‘Plain Rectangle Tool’ icon into the Ai panel (of curse you can assign your custom keyboard shortcut to it as well)
    Note: The Plain Rectangle can be easily converted into the Live one using Object > Shape > Convert to Rectangle
    Grab your copy at http://63mutants.com/subc/products/PlainRectangleTool_m01/PlainRectangleTool_m01.php Feel free to share with your friends. It’s completely free.
    I’ve also created a separate discussion https://forums.adobe.com/thread/1587587 for the Plain Rectangle Tool. If you have any comments or request please post it there. Any feedback would be greatly appreciated!
    Thanks,
    Pawel Kuc

  • How do I disable immediate delete when I pit something in the trash ?

    How do I disable immediate delete when I put something in the trash ?

    http://forums.macrumors.com/showthread.php?t=835768

  • How do you delete duplicates but keep the orginials?

    How do you deleter duplicates but keep the originals?

    Mark,
    Since you are having a problem that is not directly related to the original (and old) post (and I say that because  this thread seems to answer the OP's question, but not yours), it woud be better to ask in a new thread.  New threads have a better chance of getting answered, and you can give credit to good answers of your own questions.  I..e., if someone else answers your question in this thread, you cannot give them credit.
    When you pose your new question, it might be good to include a screen shot and a better description of how you have deduced that two projects are identical, along with what you have done to try to find them and where exactly you have looked.
    nathan

  • Can I delete an "event" but not the photos? Turn album in2 an event....how?

    If I get this right, an event basically equals every unique import of photos. Yet what am I to do if I dont want an event for every import, most especially when people email me one photo that i save to iphoto, that to me isnt a event. I spent hours upon hours creating 'albums' of what have now been coined my events.....so how do i take all the contents of one album that i created in iLife '07 and turn it into an event, even if the photos could have come from various imports along the way? iLife is telling me it's impossible, but there has to be a work around.
    So basically I want to be able to delete events, but not it's photos.
    And how do I turn my previous albums from iLife '07 & that include photos from various imports to one event in iLife '08.
    Thanks,
    Chris

    Chris
    If I get this right, an event basically equals every unique import of photos. Yet what am I to do if I dont want an event for every import, most especially when people email me one photo that i save to iphoto, that to me isnt a event. I spent hours upon hours creating 'albums' of what have now been coined my events...
    Not quite. Events are NOT albums, they are an updated version of the Rolls feature in v6. As with v6, every import created a Roll, but you can move pics between Events, create and edit them and so on, just like you could with Rolls. Your albums are not affected by this activity.
    Regards
    TD

  • How do you delete albums from an I-phone 4,only able to delete from camera roll,but not the other albums

    How do you delete albums from an I-phone 4,only able to delete from camera roll,but not the other albums

    How did the photos get onto the phone ? Only photos taken with the phone or saved from emails/websites etc can be deleted directly on the device. Photos that were synced from your computer are deleted by moving/removing/de-selecting them from where they were synced from on your computer and then re-syncing.

  • How do I delete just the firefox bookmarks but not the the bookmarks toolbar icons

    I deleted my firefox bookmarks so I could import my gooogle bookmarks,but this also deleted my firefox bookmarks toolbar entries...it took me along time to put these in again.
    How do I delete just the firefox bookmarks but not the the bookmarks toolbar icons

    What kind of problems did you get after installing the extension?
    You can try to remove the history manually in the History Manager by doing a search for a colon.
    How many history items do you have to remove?
    If you only want to do this once or occasionally then you can consider to use this code:
    *http://kb.mozillazine.org/User:Dickvl/JavaScript_Error_Console#Expire_History_By_Days
    You will have to calculate the number of days that you want to keep to remove only history items from 2013 and older (365+31+28+26)
    You can open the Browser Console (Firefox/Tools > Web Developer).
    Paste the JavaScript code in the command line and press the Enter key to run the code.
    *Toggle the devtools.chrome.enabled pref on the <b>about:config</b> page to true to enable the command line
    *https://developer.mozilla.org/Tools/Browser_Console#Browser_Console_command_line
    <pre><nowiki>
    (function(){
    /* expire history by days, based upon bug 660646 comment 5/7 - [email protected] */
    var Cc = Components.classes, Ci = Components.interfaces;
    var his = Cc["@mozilla.org/browser/nav-history-service;1"].getService(Ci.nsIBrowserHistory);
    var prs = Cc["@mozilla.org/embedcomp/prompt-service;1"].getService(Ci.nsIPromptService);
    var day = 0, obj = new Object, txt = "Expire History"; obj.value = "90";
    if (prs.prompt(null,txt,"Days of history to keep",obj,null,{})){
    day = parseInt(obj.value);
    if(!isNaN(day)&&(day>0)){
    his.removeVisitsByTimeframe(0,(new Date().setHours(0,0,0,0) - day * 86400000) * 1000);
    }else{ prs.alert(null,txt,"Error Parsing Days: "+obj.value); }
    </nowiki></pre>
    If hat doesn't work then you may have a problem with the places.sqlite database file and you may have to reset places.sqlite.
    *Places Maintenance: https://addons.mozilla.org/firefox/addon/places-maintenance/
    You can move (copy/paste) history items that you want to keep to a bookmarks folder.
    See also:
    *Norwell History Tools: https://addons.mozilla.org/firefox/addon/norwell/

  • Aperture adds the same name to all new locations, how do I delete the name but not the address?

    Aperture adds the same name to all new locations, how do I delete the name but not the address?

    It's easy to rename each unit.  When you connect your iPad and it syncs, the unit will appear on the left of the iTUnes screens just click on the unit there and you can rename it.  You should do this immediately so you can see which unit was backed up by it's name. You can sync as many decices as you want in one iTunes library and you can even share Apps as long as you're going to sync both from teh same iTunes account.  My household has 2 iPad 2s and we share our apps, and we also share downloaded books, magazines, music, etc.......

  • How Delete all the data in all BI Models, just the data but not the model

    Hi Gurus,
    i need to delete all the data of the cubes, PSA , etc , all the data of this models but not the model, how can i do this in a fast way? though a program? thanks

    Hi,
    I would prefer process chain, not program.
    Create new process chain include data target deletion component and PSA deletion component.  (Include corrosponding DSO/Cube/PSA names).
    Run process chain.
    Else you can search for FMs to delete contents from your targets.
    Delete InfoCube Data
    Regards,
    Vinay

  • How to temporarily disable mozilla

    i am AutoCAD and need ot turn off all firewall and security settings or program will not install properly. i want to keep mozilla after the program is installed.

    Please see my reply in your other thread here: [https://support.mozilla.com/en-US/questions/879640 how to temporarily disable mozilla | Firefox Support Forum | Firefox Help].
    I have some suspicions that you might not have a genuine copy of AutoCAD.

  • How do i delete files in pages, i have some old invoices in pages that i want to delete, i can delete the text but not the whole file, please help. Dennis

    As it say's above i need to delete some of my oldinvoices/estimates from my files in pages, i can get rid of the text but not the whole file, thanks Dennis

    You locate the file in the Finder(it's in the Documents item of the sidebar by default), drag it to the Trash, and empty the Trash.
    (59926)

Maybe you are looking for

  • Dropped phone in water

    Help, I was doing dishes and accidentally dropped my iPhone G4 in the water.  I retrieved it as soon as I could and dried if off.  I took out the sim card and it was dry, but I dried it anyway and I blew into everything to hopefully save it.  It acta

  • A thought - Syncing for Front Row

    I have 2 AppleTVs, several iPods, 3 Macs and 2 MacBooks in use around my house. We use Front Row on the 2 MacBooks a lot. Unfortunately we don't keep our Movies and TV Shows on the MacBook HDDs. They use shared libraries from two different iMac deskt

  • Breaking one row in to mutiple rows

    Hi all, I am doing supplier conversion through ODI. In legacy one supplier transacts in multiple currencies. During conversion i have a requirement of creating one supplier site corresponding to each currency. e.g. if in supplier site table invoice_c

  • How to make settings

    Hi,    While creating material pan number should be must & VAT in case of material, Service tax in case of service, contact name, address, phone, email is also must, assign approved to vendor & also upload vendor registration duly signed pdf format a

  • Apple (command) + tab crashes Safari

    Recently, while tabbing through forms in Safari, pressing the key combination 'command' ⌘+ 'tab' to go backward in a form has caused Safari to crash. It actually just gets the spinning beach ball of death and become completely unresponsive. I have to