Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2012

    Unanswered: XML Parsing help


    I need to parse the following XML string. This must be done in function. which get ref_cursor as OUT parameter and the XML string as VARCHAR or CLOB.

    Input XML :


    XML string must be parsed and returned result cursor as if the following way:

    Name SSN Sal
    XXXX 1001 100.50
    YYYY 1002 200.50
    ZZZZ 1003 300.50

    Please help me to write a function to get it done...

    Thanks in advance.
    Last edited by VTEST; 01-17-12 at 02:39.

  2. #2
    Join Date
    Mar 2007
    if you use at least Oracle 10gR2 (it would be nice if you posted your Oracle version), you may use XMLTABLE function for this:
    select name, roll, sal
    from xmltable('/Employees/EmplList'
            passing xmltype( <your_string_content> )
              name varchar2(4) path '/EmplList/name',
              roll integer path '/EmplList/Roll',
              sal number(4,1) path '/EmplList/sal' );
    I set data types based on your sample data - you shall adjust them according the real XML content.

    For the detailed explanation, read its description in SQL Language Reference book. It is available with other Oracle documentation books e.g. online on

  3. #3
    Join Date
    Jan 2012
    Thank you very much to you...

    Our DB version is:
    Oracle Database 11g Enterprise Edition Release - 64bit Production.

    I need one more clarification that i want to send this whole XML as string from my application. Can you tell me what data type may i use to receive this XML string input in function.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts