mutual clashes
3 posters
Unix C++ :: UNIX CPP :: RDBMS & ORACLE
Page 1 of 1
mutual clashes
hey i came up with a different kind of doubt!
i had two tables with 3 fields each!
the first table's primary key (1st field) is assigned as the foreign key to the 2nd table(3rd field)
and the second table's primary key (1st field) is assigned as the foreign key to the first table(3rd field)
now if i want to insert values into both the tables then it says integrity problem!
how to over this prob???
to state with example
let the tables be
tab1(a , b, c)
and
tab2(x ,y ,z )
z is foreign key referring a in tab1
c is foreign key referring x in tab2
if i want to insert values
(10,'park avanue',20.00) to tab1 and
(20.00,'pen - free gift',10) to tab2
it says integrity prb!! how to over come it??? but after both the values are inserted they are satisfied!!!!
i had two tables with 3 fields each!
the first table's primary key (1st field) is assigned as the foreign key to the 2nd table(3rd field)
and the second table's primary key (1st field) is assigned as the foreign key to the first table(3rd field)
now if i want to insert values into both the tables then it says integrity problem!
how to over this prob???
to state with example
let the tables be
tab1(a , b, c)
and
tab2(x ,y ,z )
z is foreign key referring a in tab1
c is foreign key referring x in tab2
if i want to insert values
(10,'park avanue',20.00) to tab1 and
(20.00,'pen - free gift',10) to tab2
it says integrity prb!! how to over come it??? but after both the values are inserted they are satisfied!!!!
Re: mutual clashes
it might be not sure due to the reason tht when i am inserting the value in the tab1 due to its references to the foreign key it tries to check with the other table or tab2 n as it is nt able to find it displays the problem. but if values are inserted before hand then you modify the table with the above mentioned constraints it automatically checks with the constraints being specified and so error does nt come up..
Vineet_More- Posts : 27
Points : 31
Join date : 2010-02-26
Re: mutual clashes
Try to temporarily disable the constraint using the following stmt.
- Code:
ALTER TABLE <TABLE_NAME> NOCHECK CONSTRAINT <CONSTRAINT_NAME>;
Re: mutual clashes
hmm ya both ideas will work! i am not asking for modification of table rather i am asking is is possible to insert the data simultaneously or paralleled ???
or like a single insert command to insert values into both the tables????
or like a single insert command to insert values into both the tables????
Re: mutual clashes
I think simultaneous insertion of the data is not possible as only one query will be executed at a time...
Vineet_More- Posts : 27
Points : 31
Join date : 2010-02-26
Unix C++ :: UNIX CPP :: RDBMS & ORACLE
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|