All Forums General
sxm 3 posts Joined 07/11
17 Feb 2014
XMLSEQUENCE and parsing name value pairs of XML data

Oracle has XMLSEQUENCE and Extract functions to parse XMLDATATYPE in to NAME VALUE pairs. I would like to do this in Teradata. IS there a similar function in Teradata?
example from Oracle.

 v_counter :=1;        

                           select count(*) into v_trx_item_node_count from  table(xmlsequence(extract(v_trx_data,'//TRNX_ITEM'))) ;

                           dbms_output.put_line('v_trx_data '|| v_trx_data.getStringVal());


                           while v_counter <=v_trx_item_node_count


                                    select EXTRACTVALUE(v_trx_data,'/TRNXS_DTL/@transactionSeq')

                                    ,EXTRACTVALUE(v_trx_data,'//TRNX_ITEM[' || v_counter || ']/@sequence') 

                                    ,EXTRACTVALUE(v_trx_data,'//TRNX_ITEM[' || v_counter || ']/@name') 

                                    ,EXTRACTVALUE(v_trx_data,'//TRNX_ITEM[' || v_counter || ']/@value') 

                                    into  v_transactionSeq, v_attr_sequence, v_attr_name, v_attr_value  from dual;


                                    v_counter := v_counter + 1;

                                END LOOP;

                   END LOOP;

Adeel Chaudhry 773 posts Joined 04/08
17 Feb 2014

Have you tried TeraXML?
It can be downloaded from below website:

-- If you are stuck at something .... consider it an opportunity to think anew.

You must sign in to leave a comment.