-- Get PF Member Data
-- #New: 06.11.17/J.Fes
-- #Lup: 11.05.18/J.Fes refactory
--                      now find out If PfMember Item
--                      is ref in PFMasterFolder -> :PFMasterFolderpuid
SELECT
 /*MsSQL TOP (1) MsSQL*/
 iMe.pitem_id as PFMember_ItemId,
 irMe.pitem_revision_id as PFMember_IrId,
 wso.pobject_name as PFMasterFolder_Name,
 f.puid AS PFMasterFolder_Puid
FROM
 infodba.PITEMREVISION irMe
 INNER JOIN infodba.PITEM iMe ON (irMe.ritems_tagu = iMe.puid)
 LEFT JOIN infodba.PCONTENTS c ON (c.pvalu_0 = iMe.puid)
 LEFT JOIN infodba.PFOLDER f ON (f.puid = c.puid)
 LEFT JOIN infodba.PIMANRELATION r ON (r.rsecondary_objectu = f.puid)
 LEFT JOIN infodba.PWORKSPACEOBJECT wso ON (wso.puid = f.puid)
WHERE
--  ptype.ptype_name = 'IMAN_UG_part_family_link'
--  AND
 irMe.puid = :ir_puid
 AND f.puid = :PFMasterFolderpuid
/*Ora AND ROWNUM <= 1 Ora*/

