473,671 Members | 2,310 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Create table syntax?

Warning: Error while executing this query:CREATE TABLE "purchaseor der" (
"PurchaseOrderI D" int(10) unsigned NOT NULL auto_increment,
"PurchaseCo st" double unsigned zerofill NOT NULL default
'00000000000000 00000000',
"PurchaseDescri ption" varchar(255) character set latin1 collate latin1_bin
NOT NULL default '',
"PurchaseeBayRe ference" varchar(45) default NULL,
"PurchaseNo tes" varchar(255) NOT NULL default '',
"PurchasePictur e" mediumblob NOT NULL,
"PurchaseQuanti ty" int(10) unsigned NOT NULL default '0',
"PurchaseOrderI nvoiceID" int(10) unsigned NOT NULL default '0',
"PurchaseDa te" datetime NOT NULL default '2004-01-01 00:00:00',
"PurchaseOrderC urrencySymbol" varchar(4) NOT NULL default '£',
"PurchasePostag e" double NOT NULL default '0',
PRIMARY KEY ("PurchaseOrder ID"),
UNIQUE KEY "idx_eBayRe f" ("PurchaseeBayR eference"),
KEY "FK_purchaseord er_1" ("PurchaseOrder InvoiceID"),
CONSTRAINT "purchaseorder_ ibfk_3" FOREIGN KEY ("PurchaseOrder InvoiceID")
REFERENCES "purchaseorderi nvoice" ("PurchaseOrder InvoiceID")
) 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 " (
"PurchaseOrderI D" 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 2506
J West wrote:
Warning: Error while executing this query:CREATE TABLE "purchaseor der" (
"PurchaseOrderI D" int(10) unsigned NOT NULL auto_increment,
"PurchaseCo st" double unsigned zerofill NOT NULL default
'00000000000000 00000000',
"PurchaseDescri ption" varchar(255) character set latin1 collate latin1_bin
NOT NULL default '',
"PurchaseeBayRe ference" varchar(45) default NULL,
"PurchaseNo tes" varchar(255) NOT NULL default '',
"PurchasePictur e" mediumblob NOT NULL,
"PurchaseQuanti ty" int(10) unsigned NOT NULL default '0',
"PurchaseOrderI nvoiceID" int(10) unsigned NOT NULL default '0',
"PurchaseDa te" datetime NOT NULL default '2004-01-01 00:00:00',
"PurchaseOrderC urrencySymbol" varchar(4) NOT NULL default '£',
"PurchasePostag e" double NOT NULL default '0',
PRIMARY KEY ("PurchaseOrder ID"),
UNIQUE KEY "idx_eBayRe f" ("PurchaseeBayR eference"),
KEY "FK_purchaseord er_1" ("PurchaseOrder InvoiceID"),
CONSTRAINT "purchaseorder_ ibfk_3" FOREIGN KEY ("PurchaseOrder InvoiceID")
REFERENCES "purchaseorderi nvoice" ("PurchaseOrder InvoiceID")
) 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 " (
"PurchaseOrderI D" 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.4163 88$Xk.274429@pd 7tw3no...
J West wrote:
Warning: Error while executing this query:CREATE TABLE "purchaseor der" (
"PurchaseOrderI D" int(10) unsigned NOT NULL auto_increment,
"PurchaseCo st" double unsigned zerofill NOT NULL default
'00000000000000 00000000',
"PurchaseDescri ption" varchar(255) character set latin1 collate
latin1_bin NOT NULL default '',
"PurchaseeBayRe ference" varchar(45) default NULL,
"PurchaseNo tes" varchar(255) NOT NULL default '',
"PurchasePictur e" mediumblob NOT NULL,
"PurchaseQuanti ty" int(10) unsigned NOT NULL default '0',
"PurchaseOrderI nvoiceID" int(10) unsigned NOT NULL default '0',
"PurchaseDa te" datetime NOT NULL default '2004-01-01 00:00:00',
"PurchaseOrderC urrencySymbol" varchar(4) NOT NULL default '£',
"PurchasePostag e" double NOT NULL default '0',
PRIMARY KEY ("PurchaseOrder ID"),
UNIQUE KEY "idx_eBayRe f" ("PurchaseeBayR eference"),
KEY "FK_purchaseord er_1" ("PurchaseOrder InvoiceID"),
CONSTRAINT "purchaseorder_ ibfk_3" FOREIGN KEY
("PurchaseOrder InvoiceID") REFERENCES "purchaseorderi nvoice"
("PurchaseOrder InvoiceID")
) 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 " (
"PurchaseOrderI D" 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
10384
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 here asking: DECLARE @TblPrefix char (3) SET @TblPrefix = 'tst' CREATE TABLE @TblPrefix + TestTable (col1 int) The point there is to have a table named tstTestTable
4
2304
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 column like this: mysql> create table t1 (c1 int unique); Query OK, 0 rows affected (0.08 sec)
2
5138
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: Incorrect syntax near 'DateUpdated'." Here is the query. Any suggestions would be appreciated, as I am trying to learn and improve. Use ACH go if exists (select * from dbo.sysobjects where id =
2
13919
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 )
9
3547
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 'Syntax error in CREATE TABLE statement' even though I am not creating a table, but a Database // - - - - - - - - - - - - sun.jdbc.odbc.JdbcOdbc aSQL=CREATE DATABASE dbtest; java.sql.SQLException:
2
22109
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 of syntex error too. How can i create a DBF table with proper indexing ability ?? The "UNIQUE" keyword has already been proved to be failed to perform normally. Please help string sql = "CREATE TABLE datafile (field1 C(10) PRIMARY KEY, field2...
4
8120
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 Access DB and then add a Linked Table pointing to the table on the SQL Server and then run an "Insert Into (linked table)" query to add the new rows. I am having a problem getting the syntax to add that linked table to my local Access DB. When I...
4
4400
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 string used by PostgreSQL system so that we could not create a table named "USER". Is that true? Thanks a lot, Emi Lu
2
2430
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 value entered in the name column. Let's say a new column is entered with the value of name column as mickey. I want to create a table called mickey, with the help of triggers. I'm really new to this and i would like some help. Thanks in advance for...
0
8388
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8907
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8593
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8663
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7423
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5687
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4215
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4396
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2046
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.