/* IR DS 28.10.09 J.Fes/T.Nestler */
Select DISTINCT
  pd.puid               As DataSetPuid,
--  wso.pobject_name      As DataSetName,
  pdt.PDATASETTYPE_NAME , 
  rev.PSEQ
From
  infodba.PDATASET pd
inner Join infodba.PREVISIONS rev   On (pd.rrev_chain_anchoru = rev.puid)
inner Join infodba.PDATASETTYPE pdt On (pd.rdataset_typeu = pdt.puid)
inner Join infodba.PIMANRELATION pr On (pr.rsecondary_objectu = pd.puid) 
-- inner Join infodba.PWORKSPACEOBJECT wso On (pd.puid = wso.puid)
inner Join infodba.PREF_LIST_0 rl  On (rl.puid = pd.puid)
-- inner Join infodba.PREF_NAMES_0 rn On ((rl.pseq = rn.pseq) and (pd.puid = rev.pvalu_0))
where 1=1 
  and PDT.PDATASETTYPE_NAME in ('UGPART','UGMASTER')
  -- and wso.pobject_name like 'JobMgrT%'
  and rev.PSEQ = 0
  and pr.rprimary_objectu = 'hYUNBtqRTzDfjB' --  :para_puid
-- order by wso.pobject_name   
  
