/* Custom Template for extracting Objects Attributes
  #New: 11.08.2014/J.Fes
  Avialable Paramters:
   - :para_ItemPiud
   - :para_IrPiud
   - :para_DsPiud
*/
SELECT ds.pformat_used As pformat_used
from infodba.PDATASET ds
 INNER JOIN infodba.PIMANRELATION pr ON (pr.rsecondary_objectu = ds.puid)
-- INNER JOIN infodba.PFORM pf ON (pf.puid = pr.rsecondary_objectu)
-- where ds.puid = :para_DsPuid;

;

SELECT at1.* -- mf.* -- pr.rsecondary_objectu -- ir.*, 
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)
 INNER JOIN infodba.PM0STGNDCRM at1 ON (at1.puid = mf.puid)
-- INNER JOIN infodba.PFORM atr1 ON (atr1.puid = mf.puid)
 -- INNER JOIN infodba.PIMANRELATION pr ON ( pr.rsecondary_objectu = IR.puid)
where IR.puid = :para_IrPuid
;
