Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

SQLPlus Oracle Primary/Foreign Key reletionships

crowejccrowejc Posts: 2Member
Hi,

Is there any way that i can force an insert into a table so as to ignore the foreign key constraint.I have two tables which have a foreign key relationship on one another.So i cannot insert into either table as it voilate a constraint on the parent table. Im using oracle sqlplus and any help would be much appreciated.

Jonathan Crowe
email crowejc@tcd.ie

Comments

  • infidelinfidel Posts: 2,900Member
    : Hi,
    :
    : Is there any way that i can force an insert into a table so as to ignore the foreign key constraint.I have two tables which have a foreign key relationship on one another.So i cannot insert into either table as it voilate a constraint on the parent table. Im using oracle sqlplus and any help would be much appreciated.

    You should drop one of the contraints. Having a circular dependency like this is a bad idea.


    [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]

    [code]
    $ select * from users where clue > 0
    no rows returned
    [/code]

  • himanshu1984himanshu1984 Posts: 3Member
    : Hi,
    :
    : Is there any way that i can force an insert into a table so as to ignore the foreign key constraint.I have two tables which have a foreign key relationship on one another.So i cannot insert into either table as it voilate a constraint on the parent table. Im using oracle sqlplus and any help would be much appreciated.
    :
    : Jonathan Crowe
    : email crowejc@tcd.ie
    :
    :

  • himanshu1984himanshu1984 Posts: 3Member
    [b][red]This message was edited by himanshu1984 at 2005-1-14 5:6:20[/red][/b][hr]
    Greetings,
    I am also a IT student, But i am from india(delhi),My email address
    is himanshu_vinayak@rediffmail.com u can chat with me on yahoo chat
    server too with my id internetjobs2004
    The answer will be making constraints only. IF U HAVE
    EMP TABLE(PRIMARY KEY) AND EMPLOYEE(FOREIGN KEY).IF U MAKING FOREIGN KEY USING CONSTRAINTS ON EMPLOYEE TABLE THEN ONLY U CAN INSERT A ROW
    BUT U HAVE TO MAKE CONSTRAINT DELETE FIRST.BECAUZ CONDITION IS THIS
    U HAVE TO HAVE THERE IDS SAME, AS U KNOW VERY MUCH
    FROM MY VIEWPOINT U USE CONSTRAINTS ON BOTH PRIMARY AND FOREIGN TABLES THEN ONLY IT CAN BE POSSIBLE.
    I WILL GIVE U MORE DETAILS SOON ON THIS TOPIC

    hi again yaar u can make insertion on parent table first and then child table. then it will be done.u can`t delete records for
    parent record. u can delete for child record
    bye
    reply me
    REPLY ME
    BYE




    : Hi,
    : :
    : : Is there any way that i can force an insert into a table so as to ignore the foreign key constraint.I have two tables which have a foreign key relationship on one another.So i cannot insert into either table as it voilate a constraint on the parent table. Im using oracle sqlplus and any help would be much appreciated.
    : :
    : : Jonathan Crowe
    : : email crowejc@tcd.ie
    : :
    : :
    :
    :





Sign In or Register to comment.