/* Description: Ermittlung der Attribute einer IR
   27.08.2008 A.Becker umgestellt auf join
    9.12.2008 J.Fes IrDescription ergaenzt 10.8.2010 Klammern angep
   19.12.2011 J.Fes ItemRevType ergaentzt  */
SELECT 
  paoIr.pcreation_date     AS IrCreateDate,
  paoIr.plast_mod_date     AS IrLastModDate,
  puIrOwningUser.puser_id  AS IrOwningUser,
  puIrLastModUser.puser_id AS IrLastModUser,
  pgIr.pname               AS IrOwningGroup,
  s.pname                  AS IrOwningSite,
  s.psite_id               AS IrOwningSite_TCE_pSite_ID,
  wso.pobject_desc         AS IrDescription,
  wso.pobject_name         AS IRName2,
  wso.pobject_type         AS IrType
FROM
  infodba.PPOM_APPLICATION_OBJECT paoIr
  INNER JOIN infodba.PPOM_USER puIrOwningUser ON (paoIr.rowning_useru = puIrOwningUser.puid)
  INNER JOIN infodba.PPOM_USER puIrLastModUser ON (paoIr.rlast_mod_useru = puIrLastModUser.puid)
  INNER JOIN infodba.PPOM_GROUP pgIr ON (paoIr.rowning_groupu = pgIr.puid)
  INNER JOIN infodba.PPOM_OBJECT o ON (paoIr.puid = o.puid)
  INNER JOIN infodba.PWORKSPACEOBJECT wso ON (paoIr.puid = wso.puid)
  LEFT OUTER JOIN infodba.PPOM_IMC s ON (o.rowning_siteu = s.puid)
where
  paoIr.puid = :para_puid
