How can a sql subvars dynamically use the login of the requestor.

Document ID : KB000090178
Last Modified Date : 14/04/2018
Show Technical Document Details
Issue:
How can a sql subvars dynamically use the login of the requestor.
Resolution:
Detailed Description and Symptoms

I?n Application Mamanger (AM) sql subvars could dynamically use the login of the requestor. This allowed a single subvar to be used hundreds of times for different database connections. With V9 is there a way to dynamically change the connection value of a varable like with AM? 

Solution

A user can have a "Default login" and the Variable Object can be set to "Apply User's default Login".

 

You will need to create a static variable object and populate that object. In your SQL Variable object, you can call the staic variable (and key work is you nee to:
 
{VARA.STATIC} to call the variable
or
{VARA.STATIC, KEYWORD} to call the variable and keyword.
 
Now here you will need two jobs. the first job will populate the static variable object:
:put_var VARA.STATIC.JOB, "OSI", "CONN.SQL.NEW.1"
 
Then the second object to call and use the SQL Variable object.
:set &ajs# = get_var(VARA.SQL.NEW.1)
 
Then both jobs can be put into a process flow and set and user the object.

Then you would need to set up a schedule object and have that started as different users. Then the Schedule will start each job as that same user (requestor).