Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > cannot create foreign key in mySql

Reply
Thread Tools

cannot create foreign key in mySql

 
 
Gaurav
Guest
Posts: n/a
 
      05-03-2005
hi.
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 :


ALTER TABLE INSTANCE ADD FOREIGN KEY (R_NAME) REFERENCES
RESOURCES(R_NAME);


the error generated is :


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


what should i do ?


regards
gaurav

 
Reply With Quote
 
 
 
 
A. Sinan Unur
Guest
Posts: n/a
 
      05-03-2005
"Gaurav" <(E-Mail Removed)> wrote in news:1115128708.887948.151540
@g14g2000cwa.googlegroups.com:


> 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.

Sinan
 
Reply With Quote
 
 
 
 
Tad McClellan
Guest
Posts: n/a
 
      05-03-2005
Gaurav <(E-Mail Removed)> wrote:


> what should i do ?



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


--
Tad McClellan SGML consulting
http://www.velocityreviews.com/forums/(E-Mail Removed) Perl programming
Fort Worth, Texas
 
Reply With Quote
 
Gaurav
Guest
Posts: n/a
 
      05-03-2005
Well, I am sorry , I posted this question here.

 
Reply With Quote
 
Christopher Nehren
Guest
Posts: n/a
 
      05-03-2005
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hibernate foreign key as primary key Lionel Java 9 08-10-2011 04:58 PM
Foreign keys in MySQL and referential integrity of Database Weasley Java 0 02-02-2010 06:12 AM
Survey - implementing CRUD with "foreign name" instead of foreign key. H5N1 ASP .Net 0 05-03-2006 11:36 PM
using mysql client to read a file to create a table in a database in a mysql server julian Ruby 8 04-06-2006 10:29 AM



Advertisments