Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Foreign key question

Status
Not open for further replies.

PeteAmsterdam

Programmer
Jun 3, 2005
76
US
I'm trying to create a relationship between foreign key
entity_platform_categories.platform_abbreviation (char 5) to reference the
base file entity_platforms.abbreviation (char 5).

The entity_platform_categories.abbreviation column (char 10) is not defined
in the relationship.
 
Sorry here is the code:
I
have a table entity_platforms defined as



create table lg/entity_platforms

(

abbreviation for column abbr char(5) not null with default,

platform varchar(100) not null with default,

primary key(abbreviation)

);



And want to define a table entity_platform_categories as



create table lg/entity_platform_categories

(

abbreviation for column abbr char(10) not null with default,

category varchar(100) not null with default,

platform_abbreviation for column platabbr char(5) not null with default,

primary key(abbreviation),

constraint platform_abbreviation_fk

foreign key (platform_abbreviation)

references lg/entity_platforms (abbreviation)

on delete no action

on update no action

);





 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top