02-17-2023 03:42 AM
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
02-18-2023 11:42 AM
@rjapala: If you’re copy pasting the expression shared by @ddellsperger, you might see an error again.
Please put the double quotes by yourself as copy pasting the quotes throws an error on the snaps.
Even after modifying your query, you see an error, can you please confirm whether the $Error_reason and $Customer_ID is a valid field? We may be overlooking the typos if you have named it differently.
Best Regards,
Darsh
02-19-2023 08:47 PM
Thank you for your reply @ddellsperger i tried giving quotes as well for string but facing same issue again
@darshthakkar yes the both fields and datatypes are valid but also the same issue am facing
@ddellsperger @darshthakkar one thing when i just validate the pipeline it is not throwing an error when i execute then it is throwing an error
02-19-2023 09:06 PM
This is really odd @rjapala.
Can you please try the following:
02-19-2023 09:20 PM
Thank you for suggestion @darshthakkar I have tried with different approach using Pipeline execute snap and i have kept the My sql execute snap in child pipeline it is working successfully now
Thanks for the support @ddellsperger @darshthakkar
02-20-2023 05:46 AM
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')