cancel
Showing results for 
Search instead for 
Did you mean: 

My sql execute snap

rjapala
New Contributor III

image
Am facing this error when am trying to update column data in SQL dynamically please can anyone give me a solution how to update with correct syntax using with expressions or without

21 REPLIES 21

ddellsperger
Moderator
Moderator

You would want to enable the expression (click the = next to the “SQL Statement” input) and then set the input field to:

"Update rakesh_sf_customer_order" + 
" SET Error_reason = " + $Error_reason + 
" Where Customer_ID = " + $Customer_ID + ";"

darshthakkar
Valued Contributor

Agreed with @ddellsperger

@rjapala: At any point you want to use the fields of input/output schema in your “execute” snaps, you’ll have to select the “=” decorator.
And when you do that, your query which is a string needs to be put under " " quotes.

rjapala
New Contributor III

Thank you so much for your reply @ddellsperger and @darshthakkar

But i am facing same issue again after i toggle the = expression

image

you’ll probably have to put single quotes around the string for $Error_reason

"Update rakesh_sf_customer_order " + 
"SET Error_reason = '" + $Error_reason + "' " 
"Where Customer_ID = " + $Customer_ID + ";"