473,513 Members | 2,618 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Create table syntax?

Warning: Error while executing this query:CREATE TABLE "purchaseorder" (
"PurchaseOrderID" int(10) unsigned NOT NULL auto_increment,
"PurchaseCost" double unsigned zerofill NOT NULL default
'0000000000000000000000',
"PurchaseDescription" varchar(255) character set latin1 collate latin1_bin
NOT NULL default '',
"PurchaseeBayReference" varchar(45) default NULL,
"PurchaseNotes" varchar(255) NOT NULL default '',
"PurchasePicture" mediumblob NOT NULL,
"PurchaseQuantity" int(10) unsigned NOT NULL default '0',
"PurchaseOrderInvoiceID" int(10) unsigned NOT NULL default '0',
"PurchaseDate" datetime NOT NULL default '2004-01-01 00:00:00',
"PurchaseOrderCurrencySymbol" varchar(4) NOT NULL default '£',
"PurchasePostage" double NOT NULL default '0',
PRIMARY KEY ("PurchaseOrderID"),
UNIQUE KEY "idx_eBayRef" ("PurchaseeBayReference"),
KEY "FK_purchaseorder_1" ("PurchaseOrderInvoiceID"),
CONSTRAINT "purchaseorder_ibfk_3" FOREIGN KEY ("PurchaseOrderInvoiceID")
REFERENCES "purchaseorderinvoice" ("PurchaseOrderInvoiceID")
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='InnoDB free: 11264 kB;
(`SupplierID`) REFER `purpleflavours/';
The server has returned this error message: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 '"purchaseorder" (
"PurchaseOrderID" int(10) unsigned NOT NULL auto_increment,
' at line 1

Can anyone explain what I am doing wrong here please!

Thanks

James West
Jul 23 '05 #1
3 2484
J West wrote:
Warning: Error while executing this query:CREATE TABLE "purchaseorder" (
"PurchaseOrderID" int(10) unsigned NOT NULL auto_increment,
"PurchaseCost" double unsigned zerofill NOT NULL default
'0000000000000000000000',
"PurchaseDescription" varchar(255) character set latin1 collate latin1_bin
NOT NULL default '',
"PurchaseeBayReference" varchar(45) default NULL,
"PurchaseNotes" varchar(255) NOT NULL default '',
"PurchasePicture" mediumblob NOT NULL,
"PurchaseQuantity" int(10) unsigned NOT NULL default '0',
"PurchaseOrderInvoiceID" int(10) unsigned NOT NULL default '0',
"PurchaseDate" datetime NOT NULL default '2004-01-01 00:00:00',
"PurchaseOrderCurrencySymbol" varchar(4) NOT NULL default '£',
"PurchasePostage" double NOT NULL default '0',
PRIMARY KEY ("PurchaseOrderID"),
UNIQUE KEY "idx_eBayRef" ("PurchaseeBayReference"),
KEY "FK_purchaseorder_1" ("PurchaseOrderInvoiceID"),
CONSTRAINT "purchaseorder_ibfk_3" FOREIGN KEY ("PurchaseOrderInvoiceID")
REFERENCES "purchaseorderinvoice" ("PurchaseOrderInvoiceID")
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='InnoDB free: 11264 kB;
(`SupplierID`) REFER `purpleflavours/';
The server has returned this error message: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 '"purchaseorder" (
"PurchaseOrderID" int(10) unsigned NOT NULL auto_increment,
' at line 1

Can anyone explain what I am doing wrong here please!

Thanks

James West


I'm just pulling at straws here as I've been unable to test it - However
you use a hook instead of an apostraphe after your REFER... and why
escape it?

Thus why the following:

REFER 'purpleflavours/';

Why not:
REFER 'purpleflavours/';

I also think that you have an imbalance of ( though I cannot find
where... I've got about a years MySQL behind me - little of it in a work
environment, so I could well be wrong... however I believe the correct
syntax for CREATE TABLE is

CREATE TABLE "tablename"
(
cell structure....
PRIMARY KEY...
);

You have an open bracket after your table name - but I cannot find where
it is closed...

I hope something above helps you in the right direction...
randelld
Jul 23 '05 #2
Thanks for that ! The SQL was automatically generated by MySQL Administrator
as part of a restore from a backup! I have not included the whole syntax as
it is 64 MB!!!!!

I have only been using MySQL for three weeks and it's lack of stability is
doing my head in!
I think I'll go back to using MSSQL for the time being until the tools
mature a little more!

Regards

James West

"Randell D." <re******************************@fiprojects.moc > wrote in
message news:GtbRd.416388$Xk.274429@pd7tw3no...
J West wrote:
Warning: Error while executing this query:CREATE TABLE "purchaseorder" (
"PurchaseOrderID" int(10) unsigned NOT NULL auto_increment,
"PurchaseCost" double unsigned zerofill NOT NULL default
'0000000000000000000000',
"PurchaseDescription" varchar(255) character set latin1 collate
latin1_bin NOT NULL default '',
"PurchaseeBayReference" varchar(45) default NULL,
"PurchaseNotes" varchar(255) NOT NULL default '',
"PurchasePicture" mediumblob NOT NULL,
"PurchaseQuantity" int(10) unsigned NOT NULL default '0',
"PurchaseOrderInvoiceID" int(10) unsigned NOT NULL default '0',
"PurchaseDate" datetime NOT NULL default '2004-01-01 00:00:00',
"PurchaseOrderCurrencySymbol" varchar(4) NOT NULL default '£',
"PurchasePostage" double NOT NULL default '0',
PRIMARY KEY ("PurchaseOrderID"),
UNIQUE KEY "idx_eBayRef" ("PurchaseeBayReference"),
KEY "FK_purchaseorder_1" ("PurchaseOrderInvoiceID"),
CONSTRAINT "purchaseorder_ibfk_3" FOREIGN KEY
("PurchaseOrderInvoiceID") REFERENCES "purchaseorderinvoice"
("PurchaseOrderInvoiceID")
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='InnoDB free: 11264 kB;
(`SupplierID`) REFER `purpleflavours/';
The server has returned this error message: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 '"purchaseorder" (
"PurchaseOrderID" int(10) unsigned NOT NULL auto_increment,
' at line 1

Can anyone explain what I am doing wrong here please!

Thanks

James West


I'm just pulling at straws here as I've been unable to test it - However
you use a hook instead of an apostraphe after your REFER... and why escape
it?

Thus why the following:

REFER 'purpleflavours/';

Why not:
REFER 'purpleflavours/';

I also think that you have an imbalance of ( though I cannot find where...
I've got about a years MySQL behind me - little of it in a work
environment, so I could well be wrong... however I believe the correct
syntax for CREATE TABLE is

CREATE TABLE "tablename"
(
cell structure....
PRIMARY KEY...
);

You have an open bracket after your table name - but I cannot find where
it is closed...

I hope something above helps you in the right direction...
randelld

Jul 23 '05 #3
J West wrote:
Thanks for that ! The SQL was automatically generated by MySQL Administrator
as part of a restore from a backup! I have not included the whole syntax as
it is 64 MB!!!!!

I have only been using MySQL for three weeks and it's lack of stability is
doing my head in!
I think I'll go back to using MSSQL for the time being until the tools
mature a little more!

Regards

James West


I can't say I know MySQL well enough to argue your points, but honestly,
I think you should stick with MySQL - I don't think its a stability
issue (though maybe it is on a windows environment). I've seen it (no
never administered it) in use from v3 running databases with several
hundred thousands of records and it works fine and dandy. In addition,
I believe independant tests comparing like for like features with an
Oracle database makes MySQL win hands down... others might flame me on
this because Oracle contains additional features not (yet?) found in
MySQL that makes chewing data better... but if you were to compare
exactly like for like, MySQL is a damned fine piece of work...

anyway...

hope you find the bug in your earlier query - and thanks for the earlier
join help...

randelld
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
10375
by: eric | last post by:
Is it possible to have part of a table name used in a CREATE statement contained in a variable? Here's what I'd like to do, although obviously the syntax of this isn't quite right or I wouldn't be...
4
2294
by: Baoqiu Cui | last post by:
Hi, I was playing with MySQL (4.1.9) during the weekend, but noticed a minor problem and would like someone to explain this to me. Basically I could successfully create a table with one unique...
2
5134
by: Karen Sullivan | last post by:
Hi, all. I'm fairly new to SQL, and I have been trying to create a table from a text file. I have been looking at this for days, and can't find the problem. I get a syntax error " Line 55:...
2
13910
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 (...
9
3536
by: Albretch | last post by:
.. I am trying to create a database in a MS Access DB via JDBC drivers. I have tried both sun.jdbc.odbc.JdbcOdbcDriver and ids.sql.IDSDriver From some reason both drivers Exceptions tell me...
2
22087
by: Maverick | last post by:
If i try to create foxpro table by the following "sql" statment, the C# compiler will only return an error "xxxx not support in non-dbc version". The "index on" command statement return some kind...
4
8103
by: Wayne Wengert | last post by:
I am trying to create a VB.NET Windows application to move some data from a local Access DB table to a table in a SQL Server. The approach I am trying is to open an OLEDB connection to the local...
4
4377
by: Ying Lu | last post by:
Hello, I have a table named "USER" under MySQL database. When I am trying to move tables from MySQL to PostgreSQL, I found that I could not create a table namely "USER". I guess "USER" is a key...
2
2418
by: lakuma | last post by:
Hi, I have a table called A (say) with columns called name, place, animal and thing. I would want to write an on insert trigger on this table, which would create a table with the name of the...
0
7257
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7157
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
7379
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,...
1
7098
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5682
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,...
1
5084
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...
0
4745
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3221
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
455
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...

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.