Menu

#2 Single column mapped to two diff tables failing

open
nobody
None
5
2011-11-03
2011-11-03
Anonymous
No

NullPointerException encountered when we have a table column which is being referred as foreign key with two tables.
Example: columnname1 is part of foreign key with two different tables

create table tblname1
( columnname1 varchar(50) not null,
columnname2 varchar(4000) not null,
columnname3 varchar(50) not null,
columnname4 varchar(50) not null,
columnname4 varchar(30) not null,
columnname6 int not null,
columnname7 timestamp,

constraint tc_pk primary key (columnname1 , columnname3 , columnname4 ),
constraint tc_fk foreign key (columnname1 , columnname3 , columnname4 )
references tblother1 (columnname1 , columnname3 , columnname4 )
on delete cascade,
constraint tc_ri_fk foreign key (columnname1)
references tblother2(columnname1)
on delete cascade );

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.