/* 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
   19.08.2013 J.Fes !!!! nicht mehr verwenden ist ersetzt durch ObjAttr.SQL  !!!!
    */
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,
  pgIr.puid                AS IrOwningGroupPuid,
  s.pname                  AS IrOwningSite,
  s.psite_id               AS OwningSite_TC_pSite_ID,
  CONVERT(wso.pobject_desc,'UTF8','WE8ISO8859P1') AS IrDescription,
  CONVERT(wso.pobject_name,'UTF8','WE8ISO8859P1') AS IrName2,
  CONVERT(wso.pobject_type,'UTF8','WE8ISO8859P1') 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 JOIN infodba.PPOM_IMC s ON (o.rowning_siteu = s.puid)
where
  paoIr.puid = :para_puid
