A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Head First Android
this week in the
Multiple columns having same foreign key
Joined: Jul 21, 2010
Sep 06, 2011 04:07:32
In a table I have 2 columns which must refer to same column of another table.
while Executing alter table query for 2nd column it says such a constraint already exists.
Can some one help.. Is this possible?
Joined: Aug 22, 2010
Sep 09, 2011 13:32:39
Yes, it should be possible, like this:
create table a(x number primary key); create table b(y number, z number); alter table b add constraint b_y foreign key(y) references a; alter table b add constraint b_z foreign key(z) references a;
Post your script and error messages if you cannot resolve it.
It is sorta covered in the
JavaRanch Style Guide
subject: Multiple columns having same foreign key
how to get fixed col width in Firefox
MySQL table joining
Developing website in English and Arabic
Dynamic creation of custom filter based on the columns visible in the tableColumnHeader
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015