View previous topic :: View next topic
|
Author |
Message |
ankvardhan
New User
Joined: 05 Sep 2008 Posts: 14 Location: Mumbai
|
|
|
|
Hi,
My Question is, if i have two tables say: Table1 & Table2 and b/w both the tables there is a Refrential Integrity is maintained.
So is it posible to Update both the Simultaneously,
I run the Query :
UPDATE TABLE1 TABLE2
SET DATE ='01/15/2009'
WHERE NAME = 'JC'
Please assist ...!! |
|
Back to top |
|
|
aishwarya_20
New User
Joined: 19 Nov 2008 Posts: 57 Location: pune
|
|
|
|
Could you please tell me on which column the referential integrity is maintained. I don't think that you can update both tables simultaneously. Anyone please correct me if i am wrong. |
|
Back to top |
|
|
ankvardhan
New User
Joined: 05 Sep 2008 Posts: 14 Location: Mumbai
|
|
|
|
Hi,
ok , lets there are columns Column1 (date) of table1 which is also present as Column2 (Date) in table2, i tried to update the above defined Columns with a single Query, but its giving me an Error of Ref. Integrity.
This means in a single query its not allowing me to Update the Date Column of both the Tables.
For this what should i have to do, whether run the Queries independently to Update it OR there is any other soution from your side.
Thanks,
Ank |
|
Back to top |
|
|
aishwarya_20
New User
Joined: 19 Nov 2008 Posts: 57 Location: pune
|
|
|
|
Yes, you need to write two queries for updating two tables. But you should first see what check is there in referential integrity definition i.e. there are lot of options as UPDATE on CASCADE etc. so that child column would be updated on basis of parent referential column. |
|
Back to top |
|
|
ankvardhan
New User
Joined: 05 Sep 2008 Posts: 14 Location: Mumbai
|
|
|
|
Thanks.. |
|
Back to top |
|
|
ashimer
Active Member
Joined: 13 Feb 2004 Posts: 551 Location: Bangalore
|
|
|
|
fyi ... There is no CASCADE for update .... only DELETE has a CASCADE option ... In your case there should not be any restriction on UPDATE ... update the two tables separately with 2 different queries ... |
|
Back to top |
|
|
aishwarya_20
New User
Joined: 19 Nov 2008 Posts: 57 Location: pune
|
|
|
|
Thanks Ashimer, i was not sure...But Two queries are needed. |
|
Back to top |
|
|
|