How to extract a clob xml string with multiple row of table tag. in 10g

i have a xml value like:
<table><c1>0</c1><c2>Mr</c2><c3>abc</c3><c4>Sharma</c4></table>
<table><c1>0</c1><c2>Mrs</c2><c3>abcd</c3><c4>Sharma</c4></table>
<table><c1>0</c1><c2>Mr</c2><c3>sabc</c3><c4>Sharma</c4></table>
<table><c1>0</c1><c2>Mrs</c2><c3>sdabc</c3><c4>Sharma</c4></table>
<table><c1>0</c1><c2>Mr</c2><c3>dabc</c3><c4>Sharma</c4></table>
<table><c1>0</c1><c2>Mr</c2><c3>adbc</c3><c4>Sharma</c4></table>
i want to insert each of <c> value in a table with respective columns according c1,c2,c3,c4
pls suggest me what to do
I use extract(xml, '/table) tab but it just read first one line & return error for other

Can you plz explain to me thisIt is because you did not provide us with a valid xml structure so I used 11g's xmlparse function to create a xmltype even with the xml not being valid (no root tag).
With a valid xml structure I could use the xmltype constructor instead and go on the same way as before:
SQL> select *
  from xmltable (
         'table'
         passing xmltype ('
                        <root>
                        <table><c1>0</c1><c2>Mr</c2><c3>abc</c3><c4>Sharma</c4></table>
                        <table><c1>0</c1><c2>Mrs</c2><c3>abcd</c3><c4>Sharma</c4></table>
                        <table><c1>0</c1><c2>Mr</c2><c3>sabc</c3><c4>Sharma</c4></table>
                        <table><c1>0</c1><c2>Mrs</c2><c3>sdabc</c3><c4>Sharma</c4></table>
                        <table><c1>0</c1><c2>Mr</c2><c3>dabc</c3><c4>Sharma</c4></table>
                        <table><c1>0</c1><c2>Mr</c2><c3>adbc</c3><c4>Sharma</c4></table>
                        </root>').extract ('root/table')
         columns c1 number path 'c1', c2 varchar2 (4) path 'c2', c3 varchar2 (6) path 'c3', c4 varchar2 (6) path 'c4')
        C1 C2     C3        C4      
         0 Mr     abc       Sharma  
         0 Mrs    abcd      Sharma  
         0 Mr     sabc      Sharma  
         0 Mrs    sdabc     Sharma  
         0 Mr     dabc      Sharma  
         0 Mr     adbc      Sharma  
6 rows selected.

Similar Messages

  • How to extract data from XML file with JavaScript

    HI All
    I am new to this group.
    Can anybody help me regarding XML.
    I want to know How to extract data from XML file with JavaScript.
    And also how to use API for XML
    regards
    Nagaraju

    This is a Java forum.
    JavaScript is something entirely different than Java, even though the names are similar.
    Try another website with forums about JavaScript.
    For example here: http://www.webdeveloper.com/forum/forumdisplay.php?s=&forumid=3

  • Loading xml file with multiple rows

    I am loading data from xml files using xsl for transformation. I have created xsl's and loaded some of the data. In an xml file with multiple row, it's only loading one (the first) row. Any idea how I can get it to read and load all the records in the file???

    Could some please help me with the above. I desparately need to move forward.

  • Making Charts with Multiple Rows in Tables

    I was wondering if anyone has figured out a way to make a chart that graphs multiple rows of data from a table in only one data set.

    Ryan,
    Ok, now we see what you are working with, but are still confused by what you want to do.
    You have two charts showing the same two years of running records. The top chart has the years superimposed over each other, and the bottom chart shows the years consecutively.
    Are you trying to take prior years (not shown) from the bottom chart and superimpose them in the top chart? If so, add as many rows to the top chart as there are years you are copying. Then use the formula:
    =Total Running Milage :: x2 where x2 is the first cell for the year involved. Copy the formula across to complete the year and repeat for as many years as you are transferring. When you are satisfied with the results, change all those formulas you placed in the top table to values (copy the block of cells, Edit > Paste Values). Finally, you can delete the bottom chart. But be sure to paste values before deleting the bottom chart.
    pw

  • Easy Question: How to split concatenated string into multiple rows?

    Hi folks,
    this might be an easy question.
    How can I split a concatenated string into multiple rows using SQL query?
    INPUT:
    select 'AAA,BBB,CC,DDDD' as data from dualDelimiter = ','
    Expected output:
    data
    AAA
    BBB
    CCC
    DDDDI'm looking for something kind of "an opposite for 'sys_connect_by_path'" function.
    Thanks,
    Tomas

    Here is the SUBSTR/INSTR version of the solution:
    SQL> WITH test_data AS
      2  (
      3          SELECT ',' || 'AAA,BBB,CC,DDDD' || ',' AS DATA FROM DUAL
      4  )
      5  SELECT  SUBSTR
      6          (
      7                  DATA
      8          ,       INSTR
      9                  (
    10                          DATA
    11                  ,       ','
    12                  ,       1
    13                  ,       LEVEL
    14                  ) + 1
    15          ,       INSTR
    16                  (
    17                          DATA
    18                  ,       ','
    19                  ,       1
    20                  ,       LEVEL + 1
    21                  ) -
    22                  INSTR
    23                  (
    24                          DATA
    25                  ,       ','
    26                  ,       1
    27                  ,       LEVEL
    28                  ) - 1
    29          )       AS NEW_STRING
    30  FROM    test_data
    31  CONNECT BY LEVEL <= LENGTH(REGEXP_REPLACE(DATA,'[^,]','')) - 1
    32  /
    NEW_STRING
    AAA
    BBB
    CC
    DDDD

  • Escape XML Strings with JDK class

    Hi,
    can anyone tell me how to escape XML-Strings with classes of the JDK?
    When searching I only was pointed to StringEscapeUtils from apache.commons.lang, but we would prefer to use the JDK instead of integrating an external lib.
    Our aim is to escape an XML attribute, so a CDATA is not applicable for us in this case.
    Thanks
    Jan

    I implemented it by myself:
    public static String escapeXmlAttribute(String attributeValue) {
            StringBuffer result = new StringBuffer();
            for (int c = 0; c < attributeValue.length(); ++c) {
                if (attributeValue.charAt(c) == '"') {
                    result.append("&#34;");
                } else if (attributeValue.charAt(c) == '&') {
                    result.append("&#38;");
                } else if (attributeValue.charAt(c) == '<') {
                    result.append("<");
                } else if (attributeValue.charAt(c) == '>') {
                    result.append(">");
                } else {
                    result.append(attributeValue.charAt(c));
            return result.toString();
        }{code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How Can I replace newScale Text Strings with Custom Values?

    How Can I replace newScale Text Strings with Custom Values?
    How can I replace newScale text strings with custom values?
    All  newScale text is customizable. Follow the procedure below to change the  value of any text string that appears in RequestCenter online pages.
    Procedure
    1. Find out the String ID of the text string you would like to overwrite by turning on the String ID display:
    a) Navigate to the RequestCenter.ear/config directory.
    b) Open the newscale.properties file and add the following name-value pair at the end of the file:res.format=2
    c) Save the file.
    d) Repeat steps b and c for the RmiConfig.prop and RequestCenter.prop files.
    e) Stop and restart the RequestCenter service.
    f) Log  in to RequestCenter and browse to the page that has the text you want  to overwrite. In front of the text you will now see the String ID.
    g) Note down the String ID's you want to change.
    2. Navigate to the directory: /RequestCenter.ear/RequestCenter.war/WEB-INF/classes/com/newscale/bfw.
    3. Create the following sub-directory: res/resources
    4. Create the following empty text files in the directory you just created:
    RequestCenter_0.properties
    RequestCenter_1.properties
    RequestCenter_2.properties
    RequestCenter_3.properties
    RequestCenter_4.properties
    RequestCenter_5.properties
    RequestCenter_6.properties
    RequestCenter_7.properties
    5. Add the custom text strings to the appropriate  RequestCenter_<Number>.properties file in the following manner  (name-value pair) StringID=YourCustomTextString
    Example: The StringID for "Available Work" in ServiceManager is 699.
    If you wanted to change "Available Work" to "General Inbox", you  would add the following line to the RequestCenter_0.properties file
         699=General Inbox
    Strings are divided into the following files, based on their numeric ID:
    Strings are divided into the following files, based on their numeric ID:
    String ID  File Name
    0 to 999 -> RequestCenter_0.properties
    1000 to 1999 -> RequestCenter_1.properties
    2000 to 2999 -> RequestCenter_2.properties
    3000 to 3999 -> RequestCenter_3.properties
    4000 to 4999 -> RequestCenter_4.properties
    5000 to 5999 -> RequestCenter_5.properties
    6000 to 6999 -> RequestCenter_6.properties
    7000 to 7999 -> RequestCenter_7.properties
    6. Turn off the String ID display by removing (or commenting out) the line "res.format=2" from the newscale.properties, RequestCenter.prop and RmiConfig.prop files
    7. Restart RequestCenter.
    Your customized text should be displayed.

    I've recently come across this information and it was very helpful in changing some of the inline text.
    However, one place that seemed out of reach with this method was the three main buttons on an "Order" page.  Specifically the "Add & Review Order" button was confusing some of our users.
    Through the use of JavaScript we were able to modify the label of this button.  We placed JS in the footer.html file that changes the value of the butt

  • Parsing XML string with XPath

    Hi,-
    I am trying to parse an XML string with xpath as follows but I am getting null for getresult.
    I am getting java.xml.xpath.xpathexpressionexception at line where
    getresult = xpathexpression.evaluate(isource); is executed.
    What should I do after
    xpathexpression = xPath.compile("a/b");in the below snippet?
    Thanks
    String xmlstring ="..."; // a valid XML string;
    Xpath xpath = XPathFactory.newInstance().newPath();
    xpathexpression = xPath.compile("a/b");
    // I guess the following line is not correct
    InputSource isource = new inputSource(new ByteArrayInputStream(xmlstring.getBytes())); right
    getresult = xpathexpression.evaluate(isource);My xml string is like:
    <a>
      <b>
         <result> valid some more tags here
         </result>
      </b>
      <c> 10
      </c>
    </a>Edited by: geoman on Dec 8, 2008 2:30 PM

    I've never used the version of evaluate that takes an InputSource. The difficulty with using it is that it does not save the DOM object. Each expression you evaluate will have to create the DOM object, use it once and then throw it away. I've yet to write a program that only needs one answer from an XML document. Usually, I use XPath to locate somewhere in a document and then read "nearby" content, add new content nearby, delete content, or move content. I'd suggest you may want to parse the XML stream and save the DOM Document.
    Second, all of the XPath expressions search from a "context node". I have not had good luck searching from the Document object, so I always get the root element first. I think the expression should work if you use the root as the context node. You will need one of the versions of evaluate that uses an Object as the parameter.

  • How to extract the actual XML document from soap message?

    My problem is " how to extract the actual XML document from soap message? "
    i just want to extract the attachment i.e. (pure XML document without any soap header or envolope).
    i could be ver thank full if u could solve my problem.
    [email protected]

    Hi,
    This is some skeleton code for extracting an attachment from a SOAPMessage.
    import javax.activation.DataHandler.;
    import javax.xml.soap.*;
    import javax.xml.message.*;
    Iterator allAttachments = message.getAttachments();
    AttachmentPart ap1 = null;
    while(allAttachments.hasNext()){
    ap1 = (AttachmentPart)allAttachments.next();
    //Check that the attachment is correct one. By looking at its mime headers
    //Convert the attachment part into its DOM representation:
    if(ap1.getContentType() == "text/xml"){
    //Use the activation dataHandler class to extract the content, then create a StreamSource from
    //the content.
    DataHandler attachmentContent = ap1.getDataHandler();
    StreamSource attachmentStream = new StreamSource(attachmentContent.getInputStream());
    DOMResult domAttachment = getDOMResult(attachmentStream);
    domAttachment holds an xml representation of the attachment.
    Hope this helps.

  • String with multiple lines

    hi
    i have a string with multiple lines inside it eg.
    hello this is
    my string with
    mutiple lines inside it
    how could i get it to print out line by line
    iv used "\n" so it detects the new lines but it doesnt seem to work
    this is my following code that doesnt seem to detect the newline
    if(multiString.equals("\n")){
    }

    nicchick wrote:
    i have a string with multiple lines inside it eg.
    hello this is
    my string with
    mutiple lines inside itWhere do you have this String? In a file? in a JTextArea of a Swing GUI? Details are important.
    if(multiString.equals("\n")){But the whole string isn't an "\n" so this won't do. Again, much will depend on the current state of the String. You may need to split it based on the current line separator.

  • How to generate a report in Excel with multiple sheets using oracle10g

    Hi,
    I need a small help...
    we are using Oracle 10g...
    How to generate a report in Excel with multiple sheets.
    Thanks in advance.
    Regards,
    Ram

    Thanks Denis.
    I am using Oraclereports 10g version, i know desformat=spreadsheet will create single worksheet with out pagination, but my requirment is like the output should be generated in .xls file, and each worksheet will have both data and graphs.
    rdf paperlayout format will not workout for generating multiple worksheets.
    Is it possible to create multiple worksheets by using .jsp weblayout(web source) in oracle reports10g. If possible please provide me some examples
    Regards,
    Ram

  • XML editor with buttons to add HTML tags via CDATA

    Hi:
    Does anyone know an XML editor with buttons to add HTML tags via CDATA?
    <?xml version="1.0" encoding="UTF-8"?>
    <content1>
    <text1>
    <![CDATA[<p><b>]]>THE ORIGINS.<![CDATA[</b><br />]]>
    He was born ...
    <![CDATA[<br /><br /><p>]]>
    Thanks in advance

    I just did a google search of "XML editor with buttons to add HTML tags via CDATA" and found this.
    I usually just write in all my XML by hand that included the CDATA tags if needed.
    http://activeden.net/item/flash-xml-editor-version-2/47884
    I hope this helps?

  • How do icloud and itunes match work with multiple libraries?

    How do icloud and itunes match work with multiple libraries?

    This forum is for troubleshooting compatibility issues between Macs and Windows, not iTunes. You'll probably want to repost your question in the iTunes discussions:
    http://discussions.apple.com/category.jspa?categoryID=150

  • TO DRAW A TABLE WITH MULTIPLE ROWS AND MULTIPLE COLOUMNS IN FORM

    Hi,
       How to draw a table with multiple rows and columns seperated by lines in form printing?

    check this
    http://sap-img.com/ts003.htm
    Regards
    Prabhu

  • Downloading .xls file with multiple rows and Columns

    Hi ALL,
    I need to genarate .xls file with multiple rows and and Columns and sent as an email.Since our customer having Problem with .CSV files need to genarate .XLS file.
    Please do the needful.
    Thanks
    Madhu

    Hi Madhu,
    You might also consider using Excel Spreadsheet XML as the target structure (namespace is urn:schemas-microsoft-com:office:spreadsheet).  When you double-click the resulting xml on a PC it automatically opens with Excel. So, users don't see a difference.  It will open up a lot of options with formatting including creating multiple worksheets if you wanted to.  Best of all you can stick with XML.
    See my response in this thread:
    Re: Convert XML data into XLS 
    Thanks,
    -Russ

Maybe you are looking for

  • Error while creating database user with first.lastname pattern

    I am trying to user the database user management connector to create oracle database user, but when i use first.lastname pattern as the database username i got an ora-01936 ERROR,07 Jul 2010 17:06:56,370,[OIMCP.DBUM],oracle.iam.connectors.dbum.common

  • AWKEY field of the Document Header of BAPI_ACC_DOCUMENT_POST

    HI Experts, I am using BAPI_ACC_DOCUMENT_POST to create Finance Postings and have a requirement to populate the Reference key field externally while using this BAPI. I am aware of the fact that if I leave the fields OBJ_TYP(Reference Transaction), OB

  • Bug: Selection Behavior

    It seems in some situations the select tools will "clear" instead of deselect.  Can anyone reproduce?  Is this a "feature"? To reproduce: 1.  Make a selection 2.  Free transform the selection 3.  Subtract from the selection CS6x64 windows 7. 

  • Mail call iTunes script

    I have a very simple Applescript saved and set to run via a Mail rule when it receives a certain type of message: tell application "iTunes" try set alarm_playlist to user playlist "Alarms" play alarm_playlist end try end tell Whenever this is called,

  • Can PHP leverage RAC cluster?

    Can PHP leverage the scalability of RAC? It appears to connect to a single node only with no TAF capability. Any guidance please Will Brown [email protected]