We are delighted to share our new EIC Delivery Methodology for efficiently managing Saviynt Implementations and delivering quick time to value. CLICK HERE.

Job : Enhanced Query Execution - How to run multiple SQL queries at a time ?

IAM_99
Regular Contributor II
Regular Contributor II

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

8 REPLIES 8

pruthvi_t
Saviynt Employee
Saviynt Employee

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.,

https://docs.saviyntcloud.com/bundle/EIC-Admin-v23x/page/Content/Chapter10-Job-Control-Panel/Job-Cat...

Thanks,


Regards,
Pruthvi

IAM_99
Regular Contributor II
Regular Contributor II

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

Looking at FAQ, you can update multiple columns of same table.

https://docs.saviyntcloud.com/bundle/EIC-FAQ/page/Content/FAQs.htm

dgandhi_0-1696003273358.png

 

 

Thanks,
Devang Gandhi
If this reply answered your question, please Accept As Solution and give Kudos to help others who may have a similar problem.

IAM_99
Regular Contributor II
Regular Contributor II

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

pruthvi_t
Saviynt Employee
Saviynt Employee

@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 ';' .

Screenshot 2023-09-27 at 1.26.48 PM.png

Thanks,


Regards,
Pruthvi

IAM_99
Regular Contributor II
Regular Contributor II

@pruthvi_t

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

IAM_99_1-1696005100490.png

 

 

 

 

 

pruthvi_t
Saviynt Employee
Saviynt Employee

@IAM_99 , Apologies, edited my last comment. You cannot use 2 select queries separated by ';' .


Regards,
Pruthvi

IAM_99
Regular Contributor II
Regular Contributor II

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