MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old March 17th, 2005, 05:31 AM
rsrivastava rsrivastava is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 1 rsrivastava User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 18 m 10 sec
Reputation Power: 0
mysql error 1005 (errno: 150)

Hi,

while writing this code in MySql 5.0.1 alfa:

CREATE TABLE PPE_JOB_TIME (USER_FKID INT NOT NULL,
JOB_NO_FKID INT NOT NULL,
TOTAL_TIME TIME NOT NULL,
FOREIGN KEY (USER_FKID) REFERENCES PPE_USER (USER_ID),
FOREIGN KEY (JOB_NO_FKID) REFERENCES PPE_JOB (JOB_NO)) TYPE=INNODB;

I am facing the problem below:
ERROR 1005 (HY000): Can't create table '.\test1\ppe_job_time.frm' (errno: 150)

Now if I remove the "TYPE=INNODB" from the above statement it runs fine. I don't know why
it is happening? With other tables it is running fine with "TYPE=INNODB"

If anybody know about it then please help me out.

Regards,
Rajat Srivastava

Reply With Quote
  #2  
Old March 28th, 2005, 07:42 PM
agwibowo agwibowo is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Posts: 1 agwibowo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 m 8 sec
Reputation Power: 0
MySQL errno:150

CREATE TABLE PPE_JOB_TIME (USER_FKID INT NOT NULL,
JOB_NO_FKID INT NOT NULL,
TOTAL_TIME TIME NOT NULL,
FOREIGN KEY (USER_FKID) REFERENCES PPE_USER (USER_ID),
FOREIGN KEY (JOB_NO_FKID) REFERENCES PPE_JOB (JOB_NO)) TYPE=INNODB;


A quick thought,
check that USER_FKID in PPE_USER table has the same type (i.e. INT, and NOT NULL)
the same goes for JOB_NO_FKID.

Good luck


regards,

Alex Wibowo.

Reply With Quote
  #3  
Old April 6th, 2005, 06:56 AM
tak2kuldeep tak2kuldeep is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2005
Location: mumbai -india
Posts: 6 tak2kuldeep User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 38 m 19 sec
Reputation Power: 0
Send a message via Yahoo to tak2kuldeep
check it out



hi
try this


check whether the table type is innodb or not ....
i mean it should be same for all the tables invoved in the foreign key issue. in your case table PPE_JOB should also be of the InnoDB type..also the field making the foreign key should be indexed..
the field data types is already similar in ur sql statements

go by it and see if it works...

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > mysql error 1005 (errno: 150)


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway