
SELECT pv.PV_ID AS PROD_ID,
	   pkg.PKG_NAME,
	   pv.PKG_VERSION,
	   DECODE( prc.PROD_ID,
	   		   NULL, '', 'disabled') AS USED,
	   DECODE( pv.DLOCKED,
	   		   'Y', 'LIMG_PRODUCT',
			   'LIMG_PRODUCT_UNPACKAGED' ) AS ICON,
	   pp.PROC_ID
  FROM RELEASE_CONTENT rc,
	   PACKAGES pkg,
	   PACKAGE_VERSIONS pv,
	   RELEASE_MANAGER.PACKAGE_PROCESSES pp,
	   (
	   	SELECT osc.PROD_ID, osc.OS_ID
		  FROM OS_CONTENTS osc
		 WHERE osc.OS_ID = 14637
	   ) osc,
	   (
	   SELECT prc.PROD_ID, prc.PROC_ID
	   	 FROM PROCESSES_CONFIG prc
		 WHERE prc.OS_ID = 14637  
	   ) prc
 WHERE rc.RTAG_ID = 3761
   AND pv.PKG_ID = pkg.PKG_ID
   AND rc.PV_ID = PV.PV_ID
   AND rc.BASE_VIEW_ID = 5 		
   AND osc.PROD_ID (+) = rc.PV_ID
   AND pp.PV_ID = osc.PROD_ID
   AND prc.PROC_ID (+) = pp.PROC_ID	
 ORDER BY UPPER(pkg.PKG_NAME), UPPER(pv.PKG_VERSION) 