Does MERGE statement executable in JDBC activity?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2024 01:48 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2024 02:57 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2024 03:20 AM
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.