Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

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

If you find the above response useful, Kindly Mark it as "Accept As Solution".

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 this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

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.

If you find the above response useful, Kindly Mark it as "Accept As Solution".

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 this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

Can you share current full json and screenshot 


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

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