SELECT DISTINCT DBS.DBNAME , PRODUCTS.PTIASPPRDID , PRODUCTS.PTIASPPRDGRPCD , PRODUCTS.PTIASPPRDCD , PRODUCTS.PTIASPPRDNAME , CASE WHEN SUBSTR(PRODUCTS.PTIASPPRDNAME , 1 , 22) = 'PeopleSoft Enterprise ' THEN SUBSTR(PRODUCTS.PTIASPPRDNAME , 23) ELSE PRODUCTS.PTIASPPRDNAME END , 'N' , 'Not Installed' FROM PS_PTIASPPRD PRODUCTS , PS_PTIASPUSERTGTS DBS WHERE 1=1 AND NOT EXISTS ( SELECT * FROM PS_PTIASPINSTPRD INSTALLED_PRODUCTS WHERE DBS.DBNAME = INSTALLED_PRODUCTS.DBNAME AND PRODUCTS.PTIASPPRDGRPCD = INSTALLED_PRODUCTS.PTIASPPRDGRPCD AND PRODUCTS.PTIASPPRDCD = INSTALLED_PRODUCTS.PTIASPPRDCD) UNION SELECT INSTALLED_PRODUCTS.DBNAME , PRODUCTS.PTIASPPRDID , PRODUCTS.PTIASPPRDGRPCD , PRODUCTS.PTIASPPRDCD , PRODUCTS.PTIASPPRDNAME , CASE WHEN SUBSTR(PRODUCTS.PTIASPPRDNAME , 1 , 22) = 'PeopleSoft Enterprise ' THEN SUBSTR(PRODUCTS.PTIASPPRDNAME , 23) ELSE PRODUCTS.PTIASPPRDNAME END , INSTALLED_PRODUCTS.PTIASPINSTALLTBL , 'Installed' FROM PS_PTIASPPRD PRODUCTS , PS_PTIASPINSTPRD INSTALLED_PRODUCTS , PS_PTIASPUSERTGTS DBS WHERE 1=1 AND DBS.DBNAME = INSTALLED_PRODUCTS.DBNAME AND PRODUCTS.PTIASPPRDCD = INSTALLED_PRODUCTS.PTIASPPRDCD AND PRODUCTS.PTIASPPRDGRPCD = INSTALLED_PRODUCTS.PTIASPPRDGRPCD
|