/* ReleaseManager Products View */
SELECT pv.PV_ID AS PROD_ID,
	   pkg.PKG_NAME,
	   pv.PKG_VERSION,
	   DECODE( osc.PROD_ID,
	   		   NULL, '', 'disabled') AS USED,
	   DECODE( pv.DLOCKED,
	   		   'Y', 'LIMG_PRODUCT',
			   'LIMG_PRODUCT_UNPACKAGED' ) AS ICON
  FROM RELEASE_CONTENT rc,
	   PACKAGES pkg,
	   PACKAGE_VERSIONS pv,
	   (
	   	SELECT osc.PROD_ID
		  FROM OS_CONTENTS osc
		 WHERE osc.OS_ID = :OS_ID
	   ) osc
 WHERE rc.RTAG_ID = :RTAG_ID_FK
   AND pv.PKG_ID = pkg.PKG_ID
   AND rc.PV_ID = PV.PV_ID
   AND (
   	   	rc.BASE_VIEW_ID = :enumPRODUCTS_BASE_VIEW_ID
		OR
	 	rc.BASE_VIEW_ID = :enumAUTOPRODUCTS_BASE_VIEW_ID    
 	   ) 		
   AND osc.PROD_ID (+) = rc.PV_ID		
 ORDER BY UPPER(pkg.PKG_NAME), UPPER(pv.PKG_VERSION) 