Jump to content

create table error


Ruth

Recommended Posts

I'm using mysql 5.1 I have four tables, I'm trying to use the fifth to link them together. I have a client, agency, phone log, and employers table that is created. I'm getting the following error when I try to create my link table placement:

 

ERROR 1005 (HY000): Can't create table './netpro/placement.frm' (errno: 150)

 

Here is my create table statement:

 

create table placement (

pclient_id int,

pagent_id char(20),

plog int,

pemp_id int,

start_date date,

pay int,

constraint pk_placement

primary key (pclient_id, pagent_id, plog, pemp_id),

constraint fk_pclient

foreign key (pclient_id) references client

on update cascade

on delete cascade,

constraint fk_pagent

foreign key (pagent_id) references agency

on update cascade

on delete cascade,

constraint fk_plog

foreign key (plog) references phone_log

on update cascade

on delete cascade,

constraint fk_pempid

foreign key (pemp_id) references employers

on update cascade

on delete cascade

) engine = innodb;

 

Link to comment
https://forums.phpfreaks.com/topic/210982-create-table-error/
Share on other sites

I took out the constraint pk_placement. I changed the data type for pay to money. Now I'm getting the following error:

 

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '

start_date datetime,

pay money,

primary key (pclient_id, pagent_id, plog, pemp_' at line 5

 

As far as I can see the date data type is correct I'm not sure about money. But it still throws the error regardless.

 

Link to comment
https://forums.phpfreaks.com/topic/210982-create-table-error/#findComment-1100426
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.