select  IVR.pVi_AuftragsNr_ABG,
        IVR.PVI_AUFTRAGSPOS_ABG,
        formTbl.PMK_ARTIKEL_ID, 
        formTbl.PMK_IDNR, 
        formTbl.PMK_BEZEICHNUNG1, 
        formTbl.PMK_BEZEICHNUNG2, 
        formTbl.PMK_VERWENDUNG, 
        formTbl.PMK_PROJEKTNR,
        formTbl.PMK_PROJEKTNAME,
        WO.POBJECT_TYPE
  
from infodba.PITEMREVISION IR     
inner JOIN infodba.PIMANRELATION            pr ON (pr.rprimary_objectu = IR.puid)
inner JOIN infodba.PFORM                    mf ON (mf.puid = pr.rsecondary_objectu) 
left JOIN infodba.PVI_MAW_MIGATTR           formTbl ON (formTbl.puid = mf.rdata_fileu) 
left join infodba.PVI_ITEMVERSIONMASTER     IVR on (IVR.puid = mf.rdata_fileu)
inner join INFODBA.PWORKSPACEOBJECT         WO on (WO.puid = mf.puid)
where IR.puid = :ir_puid and WO.PObject_Type = 'Vi_MAW_MigForm'

