cannot create foreign key in mySql

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I have got two tables with me namely "resources" and "instance"
now structure of "resources" is :
r_name varchar(50) primary key,

the structure of "instance" is  :
instance_name varchar(50) primary key,
qty int(5),
no_allocated int(5),
r_name varchar(50)

now when i want to make the "r_name" of instance table as the foreign
key to the "resources table"

i use the followin command :


the error generated is :

" ERROR 1005 (HY000) : Can't create table
'.\brocade_lab\#sql-650-f7.frm­' (errno : 150)

what should i do ?


Re: cannot create foreign key in mySql

Quoted text here. Click to load it

Ask Perl questions in a Perl newsgroup and ask database questions
in a database newsgroup.

    Tad McClellan                          SGML consulting                   Perl programming
    Fort Worth, Texas

Re: cannot create foreign key in mySql

Well, I am sorry , I posted this question here.

Re: cannot create foreign key in mySql

> Subject: cannot create foreign key in mySql

> what should i do ?

As you do not seem to have a Perl question, you should look for a forum
appropriate to your question.


Re: cannot create foreign key in mySql

On 2005-05-03, Gaurav scribbled these
curious markings:
> what should i do ?

Get a decent database, then post to a database newsgroup.

Best Regards,
Christopher Nehren
I abhor a system designed for the "user", if that word is a coded
pejorative meaning "stupid and unsophisticated". -- Ken Thompson
If you ask the wrong questions, you get answers like "42" and "God".
Unix is user friendly. However, it isn't idiot friendly.

Site Timeline