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

Delete Account query with if else condition : Exception occured while Excecuting Query

Raksha_NS
New Contributor II
New Contributor II

Hi All,

We are trying to execute two different queries based on a condition using the DELETEACCOUNTJSON in a DB connector.

But we are seeing an error which just says Error while Executing delete query - <accountname>-Exception occured while Excecuting Query

please note that the individual queries work completely fine when we do not use the if-else condition.

Below are some sample JSONs we tried executing.

${task?.source!=null && task?.source.equals("ANALYTICS_V2")?
'{"DeleteAccountQry":["DROP USER \\"${accountName}\\""]}':
'{"DeleteAccountQry":["ALTER USER \\"${accountName}\\" ACCOUNT LOCK"]}'}

${task?.source!=null && task?.source.equals("ANALYTICS_V2")?
'"DeleteAccountQry":["DROP USER \\"${accountName}\\""]':
'"DeleteAccountQry":["ALTER USER \\"${accountName}\\" ACCOUNT LOCK"]'}

Could you please let us know if there is anything else that we can try here? Any help would be appreciated since we cannot see anything other details in the logs.

8 REPLIES 8

sudeshjaiswal
Saviynt Employee
Saviynt Employee

Hello @Raksha_NS ,

Could you please try to use

task?.source == ‘ANALYTICS_V2’ 

Thanks

Hi @sudeshjaiswal ,

I tried with task?.source == ‘ANALYTICS_V2’  and I still see the same error. The logs only say "Error while Executing delete query - <accountname>-Exception occured while Excecuting Query "  and has no other details.

Use equalsIgnoreCase


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

sudeshjaiswal
Saviynt Employee
Saviynt Employee

Hello @Raksha_NS,

Can you please try with the below query,

${(task.source == 'ANALYTICS_V2')? '{\"DeleteAccountQry\":\"DROP USER '+accountName+'\"}':'{\"DeleteAccountQry\":\"ALTER USER '+accountName+' ACCOUNT LOCK\"}'} ${(task.source == 'analytics_v2')? '{\"DeleteAccountQry\":[ \"DROP USER ['+accountName+']\"]}':'{\"DeleteAccountQry\":[ \"ALTER USER ['+accountName+'] ACCOUNT LOCK\"]}'}

Thanks.

Hi @sudeshjaiswal ,

I tried the above query. It is giving me a JSON parse error and no other details.

Regards,

Raksha NS

share logs


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

Can you share current full json and screenshot 


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

prasannta
Saviynt Employee
Saviynt Employee

Hi @Raksha_NS 

I'm checking internally with the product team for sample but in the meantime can you try configuring in below format:

{
  "deleteaccountqry": "if else condition"
}

Thanks