and more in a single search tool across platforms. Read the announcement here. |
09/26/2023 11:16 AM
Hi All,
How to run multiple SQL queries at a time using Enhanced Query Execution, as if we put ; between queries its giving syntax error ?
any idea ?
Thanks,
suresh
Solved! Go to Solution.
09/27/2023 01:29 PM
Hi @IAM_99 ,
Hope you're well.
In enhanced query execution job, you have to use 'SELECT' query to build INSERT and UPDATE queries. There are certain guidelines that you need to follow while building the queries.
Please refer to below documentation link which provides information and samples on how to build queries, list of restricted tables etc.,
Thanks,
09/29/2023 08:50 AM
Hi @pruthvi_t , yes Gone through the doc , my question is with that new syntax - Can we run mutliple SQL statements ( 2 updates) , at a time ?
thanks,
suresh
09/29/2023 09:01 AM
Looking at FAQ, you can update multiple columns of same table.
https://docs.saviyntcloud.com/bundle/EIC-FAQ/page/Content/FAQs.htm
09/29/2023 09:10 AM
Hi @dgandhi , My issues is I am trying below (2 sql statements) in the enhanced query -
select 'India' as accounts__customproperty1,accountkey as accounts__primarykey from accounts where accountkey=1234;
select 'Israel' as accounts__customproperty1,accountkey as accounts__primarykey from accounts where accountkey=12345
Above giving syntax error - if i use only one query its working,
what is separator between queries as (;)semicolon is is not working
Thanks,
suresh
09/29/2023 09:13 AM - edited 09/29/2023 09:33 AM
@IAM_99 ,
You can only use one select query at a time to update. You can update multiple columns at a time but you cannot run multiple select queries seperated by ';' .
Thanks,
09/29/2023 09:32 AM
You can only use one select query at a time to update. You can update multiple columns at a time but you can run multiple select queries seperated by ';' . I am not sure you are saying it will allow or not ?
but semicolon is not working , PFB
09/29/2023 09:34 AM
@IAM_99 , Apologies, edited my last comment. You cannot use 2 select queries separated by ';' .
09/29/2023 10:54 AM - edited 09/29/2023 10:54 AM
It worked with 'union' ( instead of semicolon)like below
select 'India' as accounts__customproperty1,accountkey as accounts__primarykey from accounts where accountkey=1234 union
select 'Israel' as accounts__customproperty1,accountkey as accounts__primarykey from accounts where accountkey=12345