You can create a command job to run a script to query what you need from the db and return the results to a variable.
Use that variable's value in the autosys sendevent command to set an autosys global variable.
And yes, jobs can then use that global variable as their starting condition.
--- sample script ---
c_ename=`/opt/oracle/instantclient_11_2/sqlplus -s SCOTT/
[email protected] <
set pagesize 0 feedback off verify off heading off echo off
select ename from emp
where empno = 7566;
exit;
END`
sendevent -E SET_GLOBAL -G USER1=$c_ename
---
The above connects to the db and queries a table to get the username and then sets the username as the value for USER1 (the autosys global variable).
You could then use that in a 2nd job's definition.
Example :
condition: value(USER1)=JONES
For more details on conditions see:
https://techdocs.broadcom.com/content/broadcom/techdocs/us/en/ca-enterprise-software/intelligent-automation/workload-automation-ae-and-workload-control-center/11-3-6-SP8/reference/ae-job-information-language/jil-job-definitions/condition-attribute-define-starting-conditions-for-a-job.html#concept.dita_786915b26a4b3d5a37f3cedc0c9adf3d406804ea_GlobalVariableDependencies
For more details on global variables see:
https://techdocs.broadcom.com/content/broadcom/techdocs/us/en/ca-enterprise-software/intelligent-automation/workload-automation-ae-and-workload-control-center/11-3-6-SP8/reference/ae-commands/control-workload/sendevent-command-set-or-delete-a-global-variable.html