rjapala
3 years agoNew Contributor III
My sql execute snap
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
Here’s an expression that I’ve been using to shorthand the string concatenation in generating an sql statement
"update my_table set my_field = '\$my_update_field', my_null_field = '\$my_null_field' where my_field = '\$my_condition_field'".replace(/\$\w+/gi, m=> eval(m) ).replace(/'null'/gi, 'null')
Your missing the replace function
"UPDATE rakesh_sf_customer_order SET Error_reason = '\$Error_reason' WHERE Customer_ID = '\$Customer_ID'".replace(/\$\w+/gi, m=> eval(m) ).replace(/‘null’/gi, ‘null’)
The closing ";" is what causing the batch operation failed
Thank you so much @alchemiz
I removed semicolon ; in the my sql execute snap then the query is working fine now.
@darshthakkar Thank you for the support, Now query is working fine
Great news, something new we all learned today.
Incredible community!
CC: @dmiller