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
Employee
Employee

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 + ";"