/* Package Release Details */
 SELECT rc.insert_stamp, 
 	    ins.full_name AS insertor, 
        ins.user_email AS insertor_email,

        used.USED_COUNT,

        rc.BASE_VIEW_ID,
        vi.view_name,
        rc.PKG_STATE,
        rc.DEPRECATED_STATE,
        rc.PRODUCT_STATE,
        rc.SDKTAG_ID,
        rc.RIPPLE_STOP,
        rc.PERSIST_RIPPLE_STOP,

        rel.proj_id, 
        rel.rtag_id, 
        rel.rtag_name,
        rel.product_state_used,

        nvl2(peg.pv_id, 1, 0 ) as pegged,
        nvl2(ar.pv_id, 1, 0 ) as advisory_ripple,

        nvl(rc.in_manifest, 'N') as inManifest,
        nvl(rel.s3manifest, 'N') as s3ManifestEnabled

   FROM RELEASE_CONTENT rc,
        release_tags rel,
        pegged_versions peg,
        advisory_ripple ar,
        views vi,
   		USERS ins,
        ( 
         SELECT Count(*) AS USED_COUNT
           FROM PACKAGE_DEPENDENCIES dep
          WHERE dep.DPV_ID = :PV_ID
        ) used
 WHERE rc.RTAG_ID = :RTAG_ID  
   AND rc.PV_ID = :PV_ID
   AND rc.INSERTOR_ID = ins.USER_ID
   AND rel.rtag_id (+) = :RTAG_ID
   AND peg.rtag_id(+) = rc.RTAG_ID
   AND peg.pv_id(+) =  rc.PV_ID
   AND ar.pv_id(+) =  rc.PV_ID
   AND ar.rtag_id(+) =  rc.RTAG_ID
   AND vi.view_id(+) =  rc.base_view_id
