/* Package Details, no release information */
SELECT pv.pv_id, 
       pkg.pkg_id, 
       pkg.pkg_name, 
       pv.pkg_version, 
       pv.v_ext, 
       pv.modified_stamp, 
       pv.modifier_id,
       umd.full_name modifier, 
       umd.user_email AS modifier_email, 
       pv.created_stamp,
       pv.creator_id,
       ucr.full_name AS creator, 
       ucr.user_email AS creator_email,
       pv.owner_id, 
       onr.full_name AS owner, 
       onr.user_email AS owner_email, 
       pv.dlocked,
       pv.comments, 
       pv.pkg_label, 
       pv.src_path, 
       pv.pv_description, 
       pv.is_patch, 
       lpv.pkg_version AS previous_version, 
       pv.last_pv_id,
       pv.release_notes_info,
       pv.is_obsolete,
       pv.obsolete_comments,
       pv.build_type,
       pv.change_type,
       pv.bs_id,
       pv.is_deployable,
       pv.sbom_priority,
       pv.ripple_field,
       (SELECT count(*) FROM PACKAGE_VERSIONS cpv WHERE cpv.pkg_id = pv.pkg_id) AS pkgVerCount,
       (SELECT IS_COTS from PROJECT_EXTENTIONS WHERE Upper(ext_name) = Upper(pv.v_ext))  AS is_cots,
       (SELECT EREF from PACKAGE_EREF WHERE PV_ID = :PV_ID) AS pkg_eref
  FROM package_versions pv,
       package_versions lpv,
       PACKAGES pkg,
       users umd,
       users ucr,
       users onr
 WHERE pkg.pkg_id = pv.pkg_id
   AND pv.last_pv_id = lpv.pv_id (+)
   AND umd.user_id (+) = pv.modifier_id
   AND ucr.user_id (+) = pv.creator_id
   AND onr.user_id (+) = pv.owner_id
   AND pv.pv_id = :PV_ID 

