Welcome to dbFreaks.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Create table syntax?

 
   Database Help (Home) -> mySQL RSS
Next:  Java mysql show table status  
Author Message
jimw2

External


Since: Jan 03, 2005
Posts: 3



(Msg. 1) Posted: Thu Feb 17, 2005 6:40 pm
Post subject: Create table syntax?
Archived from groups: mailing>database>mysql (more info?)

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

 >> Stay informed about: Create table syntax? 
Back to top
Login to vote
user2734

External


Since: Jan 06, 2005
Posts: 28



(Msg. 2) Posted: Thu Feb 17, 2005 9:40 pm
Post subject: Re: Create table syntax? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Create table syntax? 
Back to top
Login to vote
jimw2

External


Since: Jan 03, 2005
Posts: 3



(Msg. 3) Posted: Thu Feb 17, 2005 9:40 pm
Post subject: Re: Create table syntax? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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." <reply.via.news.group.only.thanks.TakeThisOut@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<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Create table syntax? 
Back to top
Login to vote
user2734

External


Since: Jan 06, 2005
Posts: 28



(Msg. 4) Posted: Thu Feb 17, 2005 9:40 pm
Post subject: Re: Create table syntax? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Create table syntax? 
Back to top
Login to vote
Display posts from previous:   
   Database Help (Home) -> mySQL All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]