Reputation: 31
C# keeps coming up with an error:
Additional information: You have an error in your SQL syntax
My SQL statement is at the bottom in the picture.
Sql statement:
Update amazon_ordred_items
Set OrderItemId = 666854391288218,
SellerSKu = ..,
Title = 2pcs Fashion Cool Universal Black Real Original Car Headlight Eyelashes Sticker,
QuantityOrdered = 1,
QuantityShipped = 1,
CurrencyCode = USD,
Amount = 0.50,
ScheduledDeliveryEndDate = ..,
ScheduledDeliveryStartDate = ..,
PromotionIds = .,
Where ASIN = B00EISTU74
Upvotes: 0
Views: 59
Reputation: 5258
The problem is you are not using single quotes for any of your string values in the update
statement. Put quotes on every value that is not an integer and the sql statement will work.
Also you have values of ..
for some date fields. Assuming those are of an SQL data type DateTime
or similar, this will not work. If you don't have a date, use Null
instead.
Update amazon_ordred_items
Set OrderItemId = 666854391288218,
SellerSKu = Null,
Title = '2pcs Fashion Cool Universal Black Real Original Car Headlight Eyelashes Sticker',
QuantityOrdered = 1,
QuantityShipped = 1,
CurrencyCode = 'USD',
Amount = 0.50,
ScheduledDeliveryEndDate = Null,
ScheduledDeliveryStartDate = Null,
PromotionIds = Null,
Where ASIN = 'B00EISTU74'
Note also there's no need to update the ASIN field since you're not changing it's value and it is in your Where
clause.
Upvotes: 0
Reputation: 57764
One thing which would make this a lot better is to add quotes around the text strings in the query:
update table
set sellerSK='.',
Title='2pcs Fashion...',
(etc)
Can't tell from the screenshot if this is the problem, but it certainly looks like it is an issue.
Upvotes: 1