473,408 Members | 1,857 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

errno : 150 (create table statement)

304 100+
I am getting an error no 150 when i try to create relationships between three tables.
Here are the statements : -

TABLE A
create table a(id1 int(7),id2 int(7),primary key (id1));

TABLE B
create table b(id1 int(7),id2 int(7),primary key(id2));

TABLE C
create table c(id1 int(7),id2 int(7),foreign key(id1) references a(id1) on delete cascade,foreign key(id2) references b(id2));

any idea as to where m going wrong?
Apr 17 '07 #1
1 2926
masdi2t
37
I am getting an error no 150 when i try to create relationships between three tables.
Here are the statements : -

TABLE A
create table a(id1 int(7),id2 int(7),primary key (id1));

TABLE B
create table b(id1 int(7),id2 int(7),primary key(id2));

TABLE C
create table c(id1 int(7),id2 int(7),foreign key(id1) references a(id1) on delete cascade,foreign key(id2) references b(id2));

any idea as to where m going wrong?

base on my own experience, thus error told us tha we have error in foreign key area. maybe u specify on delete set null on not null column or something like that. just check ur foreign key design.

or for ur testing, u can create table c without any foreign key

cmiiw
Apr 19 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Morten Gulbrandsen | last post by:
USE company; DROP TABLE IF EXISTS EMPLOYEE; CREATE TABLE EMPLOYEE ( # PK SSN CHAR(9) NOT NULL, # FK SUPERSSN CHAR(9), DNO INT NOT NULL DEFAULT 1, CONSTRAINT EMPPK
0
by: Morten Gulbrandsen | last post by:
mysql> USE company; Database changed mysql> mysql> DROP TABLE IF EXISTS EMPLOYEE; -------------- DROP TABLE IF EXISTS EMPLOYEE -------------- Query OK, 0 rows affected (0.00 sec)
13
by: Markus Elfring | last post by:
Do you know a class library that can convert the error/return codes that are listed in the standard header file "errno.h" into a well-known exception hierarchy? Did anybody derive it from...
3
by: - | last post by:
i'm getting an errno: 150 when creating a table and this is what i read from the mysql manual: "Both tables must be InnoDB type. In the referencing table, there must be an index where the...
5
by: Gregory Piñero | last post by:
Hi Guys, I'm sure this is documented somewhere, I just can't locate it. Say I have this code: try: myfile=file('greg.txt','r') except IOError, error: #now psuedo code because this is what...
2
by: jith87 | last post by:
This is MySql lang...Link nt able to poen so i ve posted here.. What is error 1005 Can't create table (errno:150)....... There is a field X in a table Y. This X field has to be accessed by another...
6
by: daveftl | last post by:
Good day to all...i always have this error after making an ALTER command ... #1005 - Can't create table '.\_ftl\#sql-918_f.frm' (errno: 150) whats the cause of this error...thanks in advance..
6
by: Alvin SIU | last post by:
Hi all, I have a table in Db2 v8 like this: Team Name Role ------ -------- --------------------- A Superman Leader A Batman Member A WonderWoman Member B ...
2
by: jarea | last post by:
I have read quite a bit about this error but I have yet to find the solution to my problem. I am trying to execute the following mysql statement: alter table line_items add...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.