SELECT pv.pv_id, pkg.pkg_name, pv.pkg_version, usr.full_name
  FROM RELEASE_CONTENT rc,
  	   PACKAGE_VERSIONS pv,
	   PACKAGES pkg,
	   USERS usr,
  	   /* New deployable packages */
  	   ( 
		/* All deployable modules*/
		SELECT pv.pkg_id, pv.v_ext
		  FROM RELEASE_CONTENT rc,
		  	   PACKAGE_VERSIONS pv
		 WHERE rc.rtag_id = :RTAG_ID
		   AND rc.pv_id = pv.pv_id
		   AND NOT pv.IS_DEPLOYABLE IS NULL	
		   AND NOT rc.BASE_VIEW_ID = :BASE_VIEW_ID  
		MINUS
		/* Currently deployed modules */
		SELECT dpv.pkg_id, dpv.v_ext
		  FROM PACKAGE_DEPENDENCIES dep,
		  	   PACKAGE_VERSIONS dpv
		 WHERE dep.dpv_id = dpv.pv_id
		   AND NOT dpv.IS_DEPLOYABLE IS NULL	  
		   AND dep.pv_id IN   
		  	   (
				/* All deployment packages in release */
				SELECT rc.pv_id
				  FROM RELEASE_CONTENT rc
				 WHERE rc.RTAG_ID = :RTAG_ID
				   AND rc.BASE_VIEW_ID = :BASE_VIEW_ID
			    )
	   ) ndp		
 WHERE rc.rtag_id = :RTAG_ID
   AND rc.pv_id = pv.pv_id
   AND pv.pkg_id = pkg.pkg_id
   AND pv.MODIFIER_ID = usr.user_id
   AND pv.pkg_id = ndp.pkg_id
   AND NVL( pv.v_ext, 'LINK_A_NULL' ) = NVL( ndp.v_ext, 'LINK_A_NULL' )	
   