/* TC BomView Precice 'RwfNJtiUTzDfjB' New:06.07.14 */
SELECT
  i.puid      AS BOML_i_puid,
  i.pitem_id  AS BOML_pitem_id,
  ir.puid     AS BOML_ir_puid,
  ir.pitem_revision_id AS BOML_pitem_revision_id,
  bo.pseq_no  AS BOML_pseq_no,
  bo.puid     AS BOML_puid,
  bvr.pstruct_last_mod_date AS BOMV_pstruct_last_mod_date
FROM
 infodba.POM_BACKPOINTER bp
 INNER JOIN infodba.PPSBOMVIEWREVISION bvr ON (bvr.puid = bp.to_uid)
 INNER JOIN infodba.PPSOCCURRENCE bo ON (bo.rparent_bvru = bvr.puid)
 INNER JOIN infodba.PITEMREVISION ir ON (ir.puid = bo.rchild_itemu)
 INNER JOIN infodba.PITEM i ON (i.puid = ir.ritems_tagu)

 LEFT JOIN infodba.PPSBOMVIEW bv on (bvr.rbom_viewu = bv.puid)
 LEFT JOIN infodba.PPSVIEWTYPE bvt on (bvt.puid = bv.rview_typeu)
WHERE
  upper(bvt.pname) = 'VIEW' 
  AND bp.from_uid = :para_ir_puid ;

  
  
Select 
  pt.pname AS pt_name, 
  ptt.pval_0 AS OCN_Value
   FROM infodba.PNOTE_TEXTS ptt
     INNER JOIN infodba.PNOTE_TYPES pty ON (ptt.pseq = pty.pseq) AND (ptt.puid = pty.puid)
     INNER JOIN infodba.PNOTETYPE pt ON (pty.pvalu_0 = pt.puid)  -- AND (pt.pname = 'UG GEOMETRY')
   WHERE ptt.puid = 'hQeNJtiUTzDfjB' ; -- 'AAAAAAAAAAAAAA' --'hQYNJtiUTzDfjB' -- bo.rnotes_refu ;



