Does MERGE statement executable in JDBC activity?

Rajeshsrk
Tera Contributor

Am trying to execute MERGE statement via JDBC step in flow designer but getting error as "Given SQL statement cannot be executed". I tried adding property "mid.property.jdbc_operations" with merge operation along with default value but still getting an error. I read below statement from ServiceNow documentation, as merge statement handle inserts, updates, and deletes all in a single transaction hence it is not executable in ServiceNow I guess. Kindly advice on this case.

From Documentation: You cannot run multiple statements of different types in JDBC Step.

Rajeshsrk_0-1716280861659.png

 

 

2 REPLIES 2

Amit Verma
Kilo Patron
Kilo Patron

Hi @Rajeshsrk 

 

From the documentation, as you rightly pointed, merge queries are not possible I think. Also, are you sanitizing the query data pill before passing it to JDBC step with a Script Step ? Refer Sanitizing inputs in the official documentation and retry, it might work. https://docs.servicenow.com/bundle/washingtondc-build-workflows/page/administer/flow-designer/refere...

 

Thanks and Regards

Amit Verma


Please mark this response as correct and helpful if it assisted you with your question.

Hi Amit,

Thanks for your response.

No data pills used in the respective SQL statement, I was trying to execute MERGE statement with input value directly. Let me re-validate the input data again.