Hi AWA & SQL experts,
I would need a SQL statement (Oracle) that shows the active agents of an agent group that is assigned to the current job.
I.e.
Preview -- one agent is active, the other one inactive
We were able to get the active agent based on the OHG_OH_Idnr, but not the OH_Name. Thanks to chema14 for this statement.
select oh_idnr from oh where oh_name='HOSTG.ACTIVE.OR.INACTIVE';
Result:
Now the current statement base don the OHG_OH_Idnr
select OHGF_Name, OHG_OH_Idnr, OH_Idnr, HOST_Active from OHG
INNER JOIN OHGF ON OHGF.OHGF_OH_Idnr = OHG_OH_Idnr
INNER JOIN OH ON OH_Name = OHGF_Name
INNER JOIN HOST ON OH_Idnr = HOST_OH_Idnr
where OHG_OH_Idnr = 1007014
and Host_Active=1
ORDER BY OHGF_Name;
Result:
Which is perfect, but it would be nice to have that result based on the OH_Name of the job it is part of since it's used in an internal variable.
Maybe our SQL experts like PhilippElmer could help out with this statement.
Any help is highly appreciated.
Thanks in advance.
Cheers,
Alexander