
synopsis:

	List of packages which can be updated

description:

	Prints list of packages which can be updated for all systems in spacewalk.
	Show all newer versions of the packages which are available.

columns:

	system_id System id
  org_id  Id of organization system belongs to
  package_name  Name of the package
  package_epoch Epoch of the package
  package_version Version of the package
  package_release Release of the package
  package_arch  Architecture of the package
	newer_epoch Version of the newer package available
  newer_version Release of the newer package available
  newer_release  Architecture of the newer package available

sql:

	select * from (
  select S.id as system_id,
    S.org_id as org_id,
    PN.name as package_name,
    OPE.epoch as package_epoch,
    OPE.version as package_version,
    OPE.release as package_release,
    PA.label as package_arch,
    NPE.epoch as newer_epoch,
    NPE.version as newer_version,
    NPE.release as newer_release
  from rhnServer S
    join rhnServerNeededCache SPC on S.id=SPC.server_id
    join rhnPackage P on SPC.package_id=P.id
    join rhnPackageName PN on P.name_id=PN.id
    join rhnServerPackage SP on SP.server_id=S.id and SP.name_id=P.name_id
    join rhnPackageArch PA on SP.package_arch_id=PA.id
    join rhnPackageEvr OPE on OPE.id=SP.evr_id
    join rhnPackageEvr NPE on NPE.id=P.evr_id
	) X
	-- where placeholder
	order by org_id, system_id

