SQLPlus Oracle Primary/Foreign Key reletionships - Programmers Heaven

Howdy, Stranger!

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

Categories

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 [email protected]

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 [email protected]
    :
    :

  • 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 [email protected] 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 [email protected]
    : :
    : :
    :
    :





Sign In or Register to comment.