SELECT *
  FROM  (
  
        /* ------- ERROR: Package Information Section Incomplete ------- */
        SELECT DISTINCT 'enum_MSG_PACKAGE_CHANGETYPE_INCOMPLETE' AS err_message,
                        'fixed_issues.asp' AS rfile,
                        '#CHANGE_TYPE' AS anchor,
                        2 AS priority,
                        'ERROR' AS products_msg
                   FROM PACKAGE_VERSIONS pv
                  WHERE pv.pv_id = :PV_ID
                    AND ( pv.CHANGE_TYPE IS NULL )
                                    
        UNION

        /* ------- ERROR: Subversion to CC regression or GIT to Subversion regression ------- */
        SELECT DISTINCT 'enum_MSG_MIXED_VCS' AS err_message,
               'fixed_issues.asp' AS rfile,
               '#PACKAGE_INFORMATION' AS anchor,
               3 AS priority,
               'ERROR' AS products_msg
         FROM  PACKAGE_VERSIONS pv,
               PACKAGES pkg,
               VCS_TYPE vt
         WHERE pv.pv_id = :PV_ID
           AND pv.pkg_id = pkg.pkg_id
           AND pv.vcs_type_id  = vt.vcs_type_id
           AND PK_RMAPI.has_mixed_vcs(vt.tag, pkg.pkg_name) > 0

        UNION

        /* ------- ERROR: Package is unbuildable ------- */
        SELECT DISTINCT 'enum_MSG_UNBUILDABLE_PACKAGE' AS err_message,
               'fixed_issues.asp' AS rfile,
               '#PACKAGE_INFORMATION' AS anchor,
               1 AS priority,
               'ERROR' AS products_msg
         FROM  PACKAGE_VERSIONS pv
         WHERE pv.pv_id = :PV_ID
           AND pv.build_type  = 'U'
         
        ) errmsg
ORDER BY priority                     