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

Using Set, Declare or Select @MyVar in Connection JSON Query

kastonius
New Contributor
New Contributor

Looking to do something like the following in the CreateAccountJSONQry configurable object.

DECLARE @MY_ID AS ID = select MAX(MY_ID) from dbo.ID_TABLE

and then use the @MY_ID variable in an insert statement like the following

INSERT INTO MY_TABLE (MY_ID,...) VALUES ('@MY_ID',...)

Has anyone had success with doing something like this? I keep getting either syntax errors if I remove the declaration of the data type on my declare statement or weird casting errors saying the VARCHAR value is being cast to a INT when both the schema and my specific data type I declared is INT across the board.

1 REPLY 1

rushikeshvartak
All-Star
All-Star

No you can't use this


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