How to convert XMLTYPE in VARCHAR in ORACLE? -
i have 2 columns in table(transaction) in oracle xmltype(xml_in , xml_out). procedure not working because don't know how convert them varchar or something(i think error). procedure is:
procedure search_xml ( p_id_transaction in transaction.id_transaction%type, p_cursor out t_cursor ) begin open p_cursor select t.xml_in, t.xml_out transaction t t.id_transaction = p_id_transaction; end search_xml;
when call procedure error message in visualstudio2008 is: "unsupported oracle data type userdefined encountered." idea how working?
xmltype
has 2 methods: getstringval()
, getclobval()
convert xml structure string representations (as varchar2
, clob
respectively). unless know xml output going less 4000 characters (bytes) want use getclobval()
this:
procedure search_xml ( p_id_transaction in transaction.id_transaction%type, p_cursor out t_cursor ) begin open p_cursor select t.xml_in.getclobval() xml_in, t.xml_out.getclobval() xml_out transaction t t.id_transaction = p_id_transaction; end search_xml;
Comments
Post a Comment