0

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.

enter image description here

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
3
  • Can you make an effort to post the SQL at least... Commented Jan 10, 2014 at 22:16
  • the last few lines are the statement that was submitted Commented Jan 10, 2014 at 22:18
  • 1
    Please post the full SQL statement as formatted text, not a screenshot. And include the complete error message. And update the tags to state which DBMS you are using. Commented Jan 10, 2014 at 22:21

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.