You are here: Re: SQL Error in Update Query « PHP Language « IT news, forums, messages
Re: SQL Error in Update Query

Posted by Sean Anderson on 04/13/07 18:36

"Sean Anderson" <sean@nospam-fullingdale.com> wrote in message
news:6UPTh.56$537.9@newsfe5-win.ntli.net...
> Can anyone see a problem here?
>
> UPDATE POSTAGE SET EXTRA_KG = ITEM_TOTAL_WEIGHT - 8
> WHERE ITEM_TOTAL_WEIGHT > 8
> AND PURCHASE_ORDER_ID = 1;
>
> I get the following error
>
> 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 '- 8 WHERE
> ITEM_TOTAL_WEIGHT > 8 AND PURCHASE_ORDER_ID = 1' at line 1
>
> From the following table
>
> create table POSTAGE
>
> (
>
> postage_id int NOT NULL AUTO_INCREMENT,
>
> purchase_order_id int,
>
> package_type_id int,
>
> item_total_cost decimal(10,2),
>
> item_total_weight float,
>
> package_max_weight float,
>
> extra_kg float default 0,
>
> primary key (postage_id)
>
> );
>
>
> With columns values (in order) of 1,1,1,3.49,0.75,16,0
>
>
>
> --
>
> Regards,
>
> Sean Anderson
>


Got it ... it was a triviality from a cut/paste from a Word document, where
Word had turned the "-" into one of those other, longer dashes.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация