473,569 Members | 2,752 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Create Table error 105

1 New Member
Hi, I am getting the error message

Script line: 84 Can't create table '.\dwh\f_umsatz .frm' (errno: 150)


during execution of the following script on a windows system and mysql 5.0:


Expand|Select|Wrap|Line Numbers
  1.  CREATE TABLE d_kunden(id INT NOT NULL AUTO_INCREMENT,
  2.  
  3.        vorname varchar(45) NOT NULL,
  4.        nachname varchar(45) NOT NULL,
  5.        kundengruppe varchar(45) NOT NULL,
  6.        strasse varchar(45) NOT NULL,
  7.        ort varchar(45) NOT NULL,
  8.        mail varchar(45) NOT NULL,
  9.        bestellNr varchar(45) NOT NULL,
  10.        bundesland varchar(45) NOT NULL,
  11.            land varchar(45) NOT NULL,
  12.      PRIMARY KEY  (id)) ENGINE=INNODB;
  13.  
  14.  
  15.  
  16.  
  17. CREATE TABLE d_produkte(id INT NOT NULL AUTO_INCREMENT,
  18.  
  19.         produktgruppe varchar(45) NOT NULL,
  20.       code varchar(45) NOT NULL,
  21.       name varchar(45) NOT NULL,
  22.       einzelpreis varchar(45) NOT NULL,
  23.       rabatt varchar(45) NOT NULL,
  24.       versandkosten varchar(45) NOT NULL,
  25.       PRIMARY KEY  (id)) ENGINE=INNODB;
  26.  
  27.  
  28.  
  29.  
  30. CREATE TABLE d_verkaufspersonen(id INT NOT NULL AUTO_INCREMENT,
  31.  
  32.      vorname varchar(45) NOT NULL,
  33.      nachname varchar(45) NOT NULL,
  34.      bundesland varchar(45) NOT NULL,
  35.      land varchar(45) NOT NULL,
  36.      mail varchar(45) NOT NULL,
  37.      plz varchar(45) NOT NULL,
  38.      ort varchar(45) NOT NULL,
  39.      personalNr varchar(45) NOT NULL,
  40.      PRIMARY KEY  (id)) ENGINE=INNODB;
  41.  
  42.  
  43.  
  44. CREATE TABLE d_zeit(id INT NOT NULL AUTO_INCREMENT,
  45.      jahr varchar(45) default NULL,
  46.      monat varchar(45) default NULL,
  47.      tag varchar(45) default NULL,
  48.      PRIMARY KEY  (id)) ENGINE=INNODB;
  49.  
  50.  
  51. CREATE TABLE f_umsatz (id INT NOT NULL AUTO_INCREMENT,
  52.        datum DATE NOT NULL,
  53.        zeit_id INT NOT NULL,
  54.        kunden_id INT NOT NULL,
  55.        verkäufer_id INT NOT NULL,
  56.        produkt_id INT NOT NULL,
  57.        PRIMARY KEY(id),
  58.         INDEX (zeit_id),
  59.           FOREIGN KEY (zeit_id)
  60.           REFERENCES d_zeit(id)
  61.           ON UPDATE CASCADE ON DELETE RESTRICT,
  62.          INDEX (kunden_id),
  63.           FOREIGN KEY (kunden_id)
  64.           REFERENCES d_kunden(id)
  65.           ON UPDATE CASCADE ON DELETE RESTRICT,
  66.          INDEX (verkäufer_id),
  67.           FOREIGN KEY (verkäufer_id)
  68.           REFERENCES verkaufspersonen(id)
  69.           ON UPDATE CASCADE ON DELETE RESTRICT,
  70.          INDEX (produkt_id),
  71.           FOREIGN KEY (produkt_id)
  72.           REFERENCES dwh.produkte(id)) ENGINE=INNODB;
  73.  
I have no ideas what I made wrong.

Please consult me hints.

Frank
Jun 25 '08 #1
1 5157
Atli
5,058 Recognized Expert Expert
That error is caused by invalid foreign key restrains.

You reference a table called "verkaufsperson en". (Line 68)
Shouldn't that be "d_verkaufspers onen"?
Jun 26 '08 #2

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

Similar topics

2
4572
by: Victor M | last post by:
Hello everyone. I'm running Oracle 8.0 on NT4 (yep thats right) and running SQL*Plus 8.03. I'm typing the following at the SQL*Plus prompt: 1. Create Table EMPLOYEES 2. ( 3. FName VARCHAR(15) NOT NULL,
4
7452
by: M | last post by:
Hello, I have a very simple table, and want to create a trigger that updates the date column entry (with the current date), whenever a row gets modified. Is there a simple way of fixing this, or would I have to create 3 extra triggers, a package, etc., as described in most posts about mutating table errors? Could you please explain to me...
2
8675
by: Robin Tucker | last post by:
I have some code that dynamically creates a database (name is @FullName) and then creates a table within that database. Is it possible to wrap these things into a transaction such that if any one of the following fails, the database "creation" is rolledback. Otherwise, I would try deleting on error detection, but it could get messy. IF...
2
4285
by: db2group88 | last post by:
hi, we install db2 udb v8.1 on windows 64bit, in our application, we have sql execute "create table .... not logged initially", but from the operating system event viewer showing error stating that ADM5530E The COMMIT processing of table "TBSPACEID=3.TABLEID=15107" that used NOT LOGGED INITIALLY has been initiated. It is recommended that you...
2
13914
by: Alicia | last post by:
Does anyone know why I am getting a "Syntax error in Create Table statement". I am using Microsoft Access SQL View to enter it. Any other problems I may run into? CREATE TABLE weeks ( weekstart datetime not null primary key, weekend datetime not null )
3
3865
by: blindsey | last post by:
Is there a tool that can take an Access database and generate SQL "CREATE TABLE" statements for all the tables in it?
2
1750
wadro21
by: wadro21 | last post by:
can someone tell me what is wrong with this? Error SQL query: CREATE TABLE uploads( upload_id int( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT , file_name VARCHAR( 30 ) NOT NULL , file_size INT( 6 ) UNSIGNED NOT NULL ,
2
43931
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 constraint fk_line_item_products foreign key (product_id) references products(id) I have also tried the following statement with...
9
2939
by: AmiMitra | last post by:
i am using mysql 5.1. i have one table named as resv_record. the format is create table resv_record ( book enum('h','c','r','f','t') , resv_id int(8) auto_increment not null , user_id varchar(12) not null , primary key( book , resv_id))engine=myisam; i am creating a new table named flight_book as create table flight_booking ( resv_id int(8)...
0
7609
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7921
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7964
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6278
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5504
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2107
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1208
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
936
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.