XMLSEQUENCE and parsing name value pairs of XML data

General
sxm
N/A

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

                                LOOP

                                    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;

1 REPLY
Teradata Employee

Re: XMLSEQUENCE and parsing name value pairs of XML data

Have you tried TeraXML?

It can be downloaded from below website:

http://downloads.teradata.com/download/extensibility/teradata-xml-services

HTH!