Guest User

Untitled

a guest
Feb 22nd, 2016
346
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT
  2.     /*@o*/XMLCAST(XMLQUERY('declare namespace xdms="smth"; $p//xdms:communication/xdms:document/xdms:num/xdms:number' PASSING mh.xml AS "p" RETURNING CONTENT) AS VARCHAR2(255)) num
  3.     /*@p*/
  4.     CONVERT((XPATH('//xdms:communication/xdms:document/xdms:num/xdms:number', mh.xml, ARRAY[['xdms', 'smth']]))[1]::text::bytea, 'UTF8', 'WIN1251') AS num
  5.     /**/
  6. from medo_history mh
  7. WHERE document_id = :id
  8.   AND event_id = 1
  9.   AND is_out = 0
RAW Paste Data