SQL Query to fetch list of all processes\jobs in a recurrence

 SELECT process_job_name, 

       description, 
       
recurname 
FROM   ps_prcsrecur a, 
       
(SELECT p.prcsname  AS Process_Job_name, 
               
p.descr     AS Description, 
               
p.recurname AS recurname 
        
FROM   ps_prcsdefn p 
        
UNION 
        
SELECT jp.prcsjobname AS Process_Job_name, 
               
(SELECT j.descr 
                
FROM   ps_prcsdefn j 
                
WHERE  j.prcsname = jp.prcsname) AS Description, 
               
jp.recurname AS recurname 
        
FROM   ps_prcsjobdefn j, 
               
ps_prcsjobitem jp 
        
WHERE  j.prcsjobname = jp.prcsjobname) b
WHERE b.recurname = a.recurname 

AND a.recurname = :1

ORDER  BY 1

No comments:

Post a Comment

Excel to Component Interface Utility

  To use the Excel to Component Interface utility, you must grant access to the iScript WEBLIB_SOAPTOCI in the permission list of the user w...