Sql to extract data from XML column

Hi I am able to get the the following data to Apex_collection,
Can you help me how to transform it to muliple rows for EventNumber,EventDesc columns.
I have tried with Extractvalue it returns null.
<?xml version="1.0" encoding="ISO-8859-1"?> <ResultSet><DataRow><EventNumber>3</EventNumber><StartDate>03/10/2007</StartDate><EventDesc>Networking Skills</EventDesc><EventReference></EventReference><NumberOfAttendees>0</NumberOfAttendees><MaximumAttendees>45</MaximumAttendees><NumberOnWaitingList>0</NumberOnWaitingList><NumberInterested>0</NumberInterested><SubjectDesc>Skills Session</SubjectDesc><SkillLevelDesc>Group</SkillLevelDesc><EventStatus>TAKI</EventStatus><VenueDesc>LTG</VenueDesc><Template>N</Template><MultiSession>Y</MultiSession><EventClass>AMBA</EventClass></DataRow><DataRow><EventNumber>8</EventNumber><StartDate>10/10/2007</StartDate><EventDesc>Demystifying to IB</EventDesc><EventReference></EventReference><NumberOfAttendees>0</NumberOfAttendees><MaximumAttendees>45</MaximumAttendees><NumberOnWaitingList>0</NumberOnWaitingList><NumberInterested>0</NumberInterested><SubjectDesc>Workshop</SubjectDesc><SkillLevelDesc>Group</SkillLevelDesc><EventStatus>TAKI</EventStatus><VenueDesc>LTG</VenueDesc><Template>N</Template><MultiSession>Y</MultiSession><EventClass>AMBA</EventClass></DataRow><DataRow><EventNumber>14</EventNumber><StartDate>16/10/2007</StartDate><EventDesc>Bank of England Grad Presentation</EventDesc><EventReference></EventReference><NumberOfAttendees>0</NumberOfAttendees><MaximumAttendees>40</MaximumAttendees><NumberOnWaitingList>0</NumberOnWaitingList><NumberInterested>0</NumberInterested><SubjectDesc>Recruitment Presentation</SubjectDesc><SkillLevelDesc>Group</SkillLevelDesc><EventStatus>TAKI</EventStatus><VenueDesc>LTG</VenueDesc><Template>N</Template><MultiSession>Y</MultiSession><EventClass>AMSC</EventClass></DataRow><DataRow><EventNumber>17</EventNumber><StartDate>17/10/2007</StartDate><EventDesc>Effective use of the alumni network</EventDesc><EventReference></EventReference><NumberOfAttendees>0</NumberOfAttendees><MaximumAttendees>45</MaximumAttendees><NumberOnWaitingList>0</NumberOnWaitingList><NumberInterested>0</NumberInterested><SubjectDesc>Other</SubjectDesc><SkillLevelDesc>Group</SkillLevelDesc><EventStatus>TAKI</EventStatus><VenueDesc>LTG</VenueDesc><Template>N</Template><MultiSession>N</MultiSession><EventClass>AMBA</EventClass></DataRow><DataRow><EventNumber>18</EventNumber><StartDate>17/10/2007</StartDate><EventDesc>Personal Brand</EventDesc><EventReference></EventReference><NumberOfAttendees>0</NumberOfAttendees><MaximumAttendees>45</MaximumAttendees><NumberOnWaitingList>0</NumberOnWaitingList><NumberInterested>0</NumberInterested><SubjectDesc>Workshop</SubjectDesc><SkillLevelDesc>Group</SkillLevelDesc><EventStatus>TAKI</EventStatus><VenueDesc>LTG</VenueDesc><Template>N</Template><MultiSession>Y</MultiSession><EventClass>AMBA</EventClass></DataRow><DataRow><EventNumber>19</EventNumber><StartDate>17/10/2007</StartDate><EventDesc>Speed Reading</EventDesc><EventReference></EventReference><NumberOfAttendees>0</NumberOfAttendees><MaximumAttendees>20</MaximumAttendees><NumberOnWaitingList>0</NumberOnWaitingList><NumberInterested>0</NumberInterested><SubjectDesc>Workshop</SubjectDesc><SkillLevelDesc>Group</SkillLevelDesc><EventStatus>TAKI</EventStatus><VenueDesc>LTG</VenueDesc><Template>N</Template><MultiSession>Y</MultiSession><EventClass>AMBA</EventClass></DataRow><DataRow><EventNumber>22</EventNumber><StartDate>18/10/2007</StartDate><EventDesc>Morgan Stanley - Applying to IB</EventDesc><EventReference></EventReference><NumberOfAttendees>0</NumberOfAttendees><MaximumAttendees>30</MaximumAttendees><NumberOnWaitingList>0</NumberOnWaitingList><NumberInterested>0</NumberInterested><SubjectDesc>Recruitment Presentation</SubjectDesc><SkillLevelDesc>Group</SkillLevelDesc><EventStatus>TAKI</EventStatus><VenueDesc>LTG</VenueDesc><Template>N</Template><MultiSession>Y</MultiSession><EventClass>MSCFINRISK</EventClass></DataRow><DataRow><EventNumber>27</EventNumber><StartDate>22/10/2007</StartDate><EventDesc>Power &Energy Group</EventDesc><EventReference></EventReference><NumberOfAttendees>0</NumberOfAttendees><MaximumAttendees>30</MaximumAttendees><NumberOnWaitingList>0</NumberOnWaitingList><NumberInterested>0</NumberInterested><SubjectDesc>Recruitment Presentation</SubjectDesc><SkillLevelDesc>Group</SkillLevelDesc><EventStatus>TAKI</EventStatus><VenueDesc>LTG</VenueDesc><Template>N</Template><MultiSession>Y</MultiSession><EventClass>ACP</EventClass></DataRow></ResultSet>

Or if you have oracle version >= 10gR2 then this is better:
select b.* from
  (SELECT xmltype(:your_xml) your_xml FROM dual) a,
  XMLTable
  ('/ResultSet/DataRow'
    PASSING a.your_xml
    COLUMNS
      EventNumber varchar2(10) PATH '/DataRow/EventNumber',
      EventDesc varchar2(10) PATH '/DataRow/EventDesc'
  ) bBest regards,
Hrvoje.

Similar Messages

  • Extract data from xml column to other table

    Hi
    I have a table with clob column, inside have a xml, How can I to extract data inside column
    Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
    PL/SQL Release 9.2.0.8.0 - Production
    CORE     9.2.0.8.0     Production
    TNS for IBM/AIX RISC System/6000: Version 9.2.0.8.0 - Production
    NLSRTL Version 9.2.0.8.0 - Production

    thank you
    I have a table
    SQL> desc xml_documents;
    Name      Type          Nullable Default Comments
    DOCNAME   VARCHAR2(200)                          
    XMLDOC    CLOB          Y                        
    TIMESTAMP DATE          Y                         inside XMLDOC column there is only a record below
    <!-- claim77804.xml -->
    <Claim>
    <ClaimId>77804</ClaimId>
    <Policy>12345</Policy>
    <Settlements>
    <Payment Approver="JCOX">1000</Payment>
    <Payment Approver="PSMITH">1850</Payment>
    </Settlements>
    <DamageReport>
    The insured's <Vehicle Make="Volks">Beetle</Vehicle>
    broke through the guard rail and plummeted into a ravine.
    The cause was determined to be <Cause>faulty brakes</Cause>.
    Amazingly there were no casualties.
    </DamageReport>
    </Claim>I tried to use example from : http://www.oracle-base.com/articles/9i/xmlsequence.php
    SELECT extract(value(d), '//POLICY/text()').getStringVal() AS empno
    FROM    xml_documents x,
           table(xmlsequence(extract(x.xmldoc, '/ROWSET/Claim'))) d;But no work, show me error
    ORA-00932: inconsistent datatypes: expected - got -

  • How to extract data from xml and insert into Oracle table

    Hi,
    I have a large xml file. which will have hundreds of the following transaction tags having column names and there values.
    There is a table one of the schema with coulums "actualCostRate","billRate"....etc.
    I need to extract the values of these columns and insert into the table
    <Transaction actualCostRate="0" billRate="0" chargeable="1" clientID="NikuUK" chargeCode="LCOCD1" externalID="L-RESCODE_UK1-PROJ_UK_CNT_GBP-37289-8" importStatus="N" projectID="TESTPROJ" resourceID="admin" transactionDate="2002-02-12" transactionType="L" units="11" taskID="5017601" inputTypeCode="SALES" groupId="123" voucherNumber="ABCVDD" transactionClass="ABCD"/>
    <Transaction actualCostRate="0" billRate="0" chargeable="1" clientID="NikuEU" chargeCode="LCOCD1" externalID="L-RESCODE_US1-PROJ_EU_STD2-37291-4" importStatus="N" projectID="TESTPROJ" resourceID="admin" transactionDate="2002-02-04" transactionType="L" units="4" taskID="5017601" inputTypeCode="SALES" groupId="124" voucherNumber="EEE222" transactionClass="DEFG"/>

    Re: Insert from XML to relational table
    http://www.google.ae/search?hl=ar&q=extract+data+from+xml+and+insert+into+Oracle+table+&btnG=%D8%A8%D8%AD%D8%AB+Google&meta=

  • Extract data from XML file to Oracle database

    Dear All
    Please let me know, how to extract data from XML file to Oracle database which includes texts & images.
    Thanking You
    Regards Lakmal Marasinghe

    I would do it from the database, but then again, I am a database / PL/SQL guy.
    IMHO the database will deliver you with more options. I don't know about "speed" between the two.

  • 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

  • Hi, extract data from xml file and insert into another exiting xml file

    i am searching code to extract data from xml file and insert into another exiting xml file by a java program. I understood it is easy to extract data from a xml file, and how ever without creating another xml file. We want to insert the extracted data into another exiting xml file. Suggestions?
    1st xml file which has two lines(text1.xml)
    <?xml version="1.0" encoding="iso-8859-1"?>
    <xs:PrintDataRequest xmlns:xs="http://com.unisys.com/Anid"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://com.unisys.com/Anid file:ANIDWS.xsd">
    <xs:Person>
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://com.unisys.com/Anid file:ANIDWS.xsd">
    These two lines has to be inserted in the existing another xml(text 2.xml) file(at line 3 and 4)
    Regards,
    bubbly

    Jadz_Core wrote:
    RandomAccessFile? If you know where you want to insert it.Are you sure about this? If using this, the receiving file would have to have bytes inserted that exactly match the number of bytes replaced. I'm thinking that you'll likely have to stream through the second XML with a SAX parser and copy information (or insert new information) as you stream with an XML writer of some sort.

  • Extract data from xml file and insert into another exiting xml fil

    hello,
    i am searching extract data from xml file and insert into another exiting xml file by a java program. I understood it is easy to extract data from a xml file, and how ever without creating another xml file. We want to insert the extracted data into another exiting xml file. Suggestions?
    Regards,
    Zhuozhi

    If the files are small, you can load the target file in a DOM document, insert the data from the source file and persist the DOM.
    If the files are large, you probably want to use a StAX or SAX.

  • Extracting data from XML

    Im fairly new to XML & web services so bear with me please.
    Im trying to extract data from XML documents where the structure/element names are unknown.
    The condition for extracting data is if keyword matches some data content.
    Im using Java and the DOM API with xcerces and I've managed to parse the XML file, what I need to do next is to traverse the data content checking against keywords and if a keyword matches then to strip the tags and save the data locally ?
    Ive trawled through all the documentaion but as theres so many different methods Im somewhat unsuare which is the best way to proceed.
    thanks

    tough question, i would suggest looking at jdom as solution for you, because it is a relatively simple one to use for searching through a dom. aside from that, its probably up to you what sort of logic you want to use.

  • Extracting data from xml spreadsheet for JSP

    Hi,
    Currently i am developing a web application where user can upload a MS excel file, then the application will extract data needed and store into database. But facing problems where those excel files may content massive images that make the file size too large to be upload on to the web. Now i try to export those excel files into xml spreadsheet, to get only text data. Need helps on how to extract data from xml spreadsheet. Which API needed?
    Thanks

    Without getting into too much detail, a DTD defines the elements that can appear in an xml file, the order they can appear in, which elements can be nested within which other elements, what each element can contain, etc, etc. In short, a DTD defines the structure of the xml file and Microsoft defined a DTD for the xml files that are output by Excel.
    This is not taken from an xml file produced by Excel but DTDs look a llittle like this very basic example.
    <!DOCTYPE note [
      <!ELEMENT note (to,from,heading,body)>
      <!ELEMENT to      (#PCDATA)>
      <!ELEMENT from    (#PCDATA)>
      <!ELEMENT heading (#PCDATA)>
      <!ELEMENT body    (#PCDATA)>
    ]>If you open the one produced for you by Excel in Wordpad or another simple text editor, you may see something like this in there.
    However, if you are going to use a parser to access the file for you do not worry about getting to grips with DTDs for a short, simple project.

  • How to extract data from xml file and store that data inti data base table

    Hii All
    I have one table that table contains one column that column contain an XML file
    I want to extract data from that XML file and want to store that extracted data into an other table.
    That xml file has different different values
    I want to store that values into table in diff diff columns

    Hi,
    I am also facing the same problem.I have a .xml file and i need to import the data into the custom table in oracle database.
    Can you please let me know if you know the solution how to do it in oracle apps.
    Thanks,

  • Extract Data from XML and Load into table using SQL*Loader

    Hi All,
    We have a XML file (sample.xml) which contains credit card transaction information. We have a standard SQL*Loader control file which loads the data from a flat file and the control file code is written as position based method. Our requirement is to use this control file as per our requirement(i.e) load the data into the table from our XML file), But we need help in converting the XML to a flat file or Extract the data from the XML tags and pass the information to the control file and in turn it loads the table.
    Your suggestion is highly appreciated.
    Thanks in advance

    Hi,
    First of all go to PSA maintanance ( Where you will see PSA records ).
    Goto list---> Save-> File---> Spreadsheet (Choose Radio Button)
    > Give the proper file name where you want to download and then-----> Generate.
    You will get ur PSA data in Excel Format.
    Thanks
    Mayank

  • Extract DATE from TEXT column

    Dear all,
    I have the following comment in column in one my table. Is there a smart way to extract the
    DATE from the text, It may be in any date format.
    'My comments (written submissions sent on 29-SEP-2006)'
    'My comments are 24 September 2009 9.30 '
    'My comments, 15.12.2008'
    'My comments on 25.11.2008'
    'form 2008/ My comments 11 JUN 2007'
    'my comment on 4-4-2008'
    'My comm. -extens.not possible - 23.03.2007 09:00'
    'MyComm.on 04/04/06'
    'My comments on 15 Sep 2009 at 9.15h at EPO, changed on 16 sep 09' -- in this case 15 Sep 2009 is needed
    Please share your views.
    Regards,
    Vikash Kumar

    Hi,Try with this one
    SELECT REGEXP_SUBSTR('My comments (written submissions sent on 29-SEP-2006','[0-9]+[-./[:space:][:alnum:]][[:alnum:]]+[-./[:space:][0-9]]*[0-9]*') a FROM dual
    union all
    SELECT REGEXP_SUBSTR('My comments are 24 September 2009 9.30 ','[0-9]+[-./[:space:][:alnum:]][[:alnum:]]+[-./[:space:][0-9]]*[0-9]*') a FROM dual
    union all
    SELECT REGEXP_SUBSTR('My comments, 15.12.2008','[0-9]+[-./[:space:][:alnum:]][[:alnum:]]+[-./[:space:][0-9]]*[0-9]*') a FROM dual
    union all
    SELECT REGEXP_SUBSTR('My comments on 25.11.2008','[0-9]+[-./[:space:][:alnum:]][[:alnum:]]+[-./[:space:][0-9]]*[0-9]*') a FROM dual
    union all
    SELECT REGEXP_SUBSTR('form 2008/ My comments 11 JUN 2007','[0-9]+[-./[:space:][:alnum:]][[:alnum:]]+[-./[:space:][0-9]]*[0-9]*') a FROM dual
    union all
    SELECT REGEXP_SUBSTR('my comment on 4-4-2008','[0-9]+[-./[:space:][:alnum:]][[:alnum:]]+[-./[:space:][0-9]]*[0-9]*') a FROM dual
    union all
    SELECT REGEXP_SUBSTR('My comm. -extens.not possible - 23.03.2007 09:00','[0-9]+[-./[:space:][:alnum:]][[:alnum:]]+[-./[:space:][0-9]]*[0-9]*') a FROM dual
    union all
    SELECT REGEXP_SUBSTR('MyComm.on 04/04/06','[0-9]+[-./[:space:][:alnum:]][[:alnum:]]+[-./[:space:][0-9]]*[0-9]*') a FROM dual
    union all
    SELECT REGEXP_SUBSTR('My comments (written submissions sent on 29SEP2006','[0-9]+[-./[:space:][:alnum:]][[:alnum:]]+[-./[:space:][0-9]]*[0-9]*') a FROM dual
    union all
    SELECT REGEXP_SUBSTR('My comments (written submissions sent on 29SEP.2006','[0-9]+[-./[:space:][:alnum:]][[:alnum:]]+[-./[:space:][0-9]]*[0-9]*') a FROM dual
    union all
    SELECT REGEXP_SUBSTR('My comments (written submissions sent on 29022006','[0-9]+[-./[:space:][:alnum:]][[:alnum:]]+[-./[:space:][0-9]]*[0-9]*') a FROM dual

  • How to extract data from xml file in owb 10.2?

    I have to load data from an xml file into a relational table , may i know how to do it in owb 10.2.

    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

  • How to extract data from xml field to dropdown list?

    Hi,
    I have designed a form and connected to a SQL server database using a web service. The XML data retrieved from wsdl connection is currently hold in a text field called 'XMLfield'. I need to extract the data such as 'PersonnelName' from XMLfield into a dropdown list. I used the following code and I do not get any error, but nothing come up and all my fields in the forms become bank when i click the dropdown list.
    I would appreciate it if anyone can help me with this issue.
    form1.DropDownList::click - (JavaScript, client)
    xfa.datasets.data.loadXML(form1.XMLfield.rawValue,0,1);
    form1.XMLfield.rawValue = xfa.datasets.data.saveXML();
    var dataGroup = xfa.resolveNode("xfa.data.Timesheet.Personnel.PersonnelName");
    var dataGroupLength = dataGroup.nodes.length;
    if (dataGroupLength == 0) {
      xfa.host.messageBox("There are no parts in the XML doc");
    else {
      for (var i=0; i < dataGroupLength; i++){
        this.addItem(dataGroup.nodes.item(i).nodes.item(0).value);
    Thanks,
    Roya

    Hi Roya,
    I think the loadXML will override your form data, so blanking out your fields.  You could try loading the xml data at the xfa.datasets level (that is xfa.datasets.loadXML(form1.XMLfield.rawValue,0,1);) or using E4X to process the XML.
    Another option though might be more rework is to use the Acrobat SOAP api which will return you a JavaScript object so you wont have to do any XML work.
    There's a good intro to the SOAP api here, http://www.avoka.com/blog/page/11/.
    Regards
    Bruce

  • Extracting data from XML using xmltype and extract

    Hello all,
    I want to write a pl/sql functions that takes a clob as an input and return a some data extracted from the data passed into it.
    the input will be an xml similar to the following:
    <FIXML xsi:schemaLocation="http://www.finacle.com/fixml executeFinacleScript.xsd" xmlns="http://www.finacle.com/fixml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <Header>
            <ResponseHeader>
                <RequestMessageKey>
                    <RequestUUID>IVR201306180841060310000000000000000</RequestUUID>
                    <ServiceRequestId>executeFinacleScript</ServiceRequestId>
                    <ServiceRequestVersion>10.3</ServiceRequestVersion>
                    <ChannelId>IVR</ChannelId>
                </RequestMessageKey>
                <ResponseMessageInfo>
                    <BankId>01</BankId>
                    <TimeZone></TimeZone>
                    <MessageDateTime>2013-06-18T05:36:55.918</MessageDateTime>
                </ResponseMessageInfo>
                <UBUSTransaction>
                    <Id/>
                    <Status/>
                </UBUSTransaction>
                <HostTransaction>
                    <Id/>
                    <Status>SUCCESS</Status>
                </HostTransaction>
                <HostParentTransaction>
                    <Id/>
                    <Status/>
                </HostParentTransaction>
                <CustomInfo/>
            </ResponseHeader>
        </Header>
        <Body>
            <executeFinacleScriptResponse>
                <ExecuteFinacleScriptOutputVO>
                    <executeFinacleScript_customData>
                        <DataCategory>ACC</DataCategory>
                        <New_Data>0001019300101001</New_Data>
                    </executeFinacleScript_customData>
                </ExecuteFinacleScriptOutputVO>
            </executeFinacleScriptResponse>
        </Body>
    </FIXML>'
    I want to extract the value of new_data.
    I wrote the following anonymous block to test the code :
    declare
    xparam xmltype;
    v_xpath varchar2(500);
    begin
    xparam:=xmltype('<FIXML xsi:schemaLocation="http://www.finacle.com/fixml executeFinacleScript.xsd"  xmlns="http://www.finacle.com/fixml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <Header>
            <ResponseHeader>
                <RequestMessageKey>
                    <RequestUUID>IVR201306180841060310000000000000000</RequestUUID>
                    <ServiceRequestId>executeFinacleScript</ServiceRequestId>
                    <ServiceRequestVersion>10.3</ServiceRequestVersion>
                    <ChannelId>IVR</ChannelId>
                </RequestMessageKey>
                <ResponseMessageInfo>
                    <BankId>01</BankId>
                    <TimeZone></TimeZone>
                    <MessageDateTime>2013-06-18T05:36:55.918</MessageDateTime>
                </ResponseMessageInfo>
                <UBUSTransaction>
                    <Id/>
                    <Status/>
                </UBUSTransaction>
                <HostTransaction>
                    <Id/>
                    <Status>SUCCESS</Status>
                </HostTransaction>
                <HostParentTransaction>
                    <Id/>
                    <Status/>
                </HostParentTransaction>
                <CustomInfo/>
            </ResponseHeader>
        </Header>
        <Body>
            <executeFinacleScriptResponse>
                <ExecuteFinacleScriptOutputVO>
                    <executeFinacleScript_customData>
                        <DataCategory>ACC</DataCategory>
                        <New_Data>0001019300101001</New_Data>
                    </executeFinacleScript_customData>
                </ExecuteFinacleScriptOutputVO>
            </executeFinacleScriptResponse>
        </Body>
    </FIXML>');
    v_xpath:='//New_Data/text()';-
    dbms_output.put_line(xparam.EXTRACT(v_xpath).GETSTRINGVAL());
    end;
    but I get the following Error:
    dbms_output.put_line(xparam.EXTRACT(v_xpath).GETSTRINGVAL());
    end;
    Error at line 1
    ORA-30625: method dispatch on NULL SELF argument is disallowed
    ORA-06512: at line 46
    the problem is that when I remove : xmlns="http://www.finacle.com/fixml" attribute from the root node the code works correctly.
    of course , I can simply use replace to remove it, but I want to know what is causing the error.
    I am using oracle database 10g

    Let me explain that the issue is not only related to Oracle.
    If you google a bit for default namespace and Xpath you will find many topic.
    Basically when you have an XML having a definition of namespace without a prefix:
    i.e.:
    <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
        <title>Example XHTML document</title>
      </head>
      <body>
        <p>Sample content</p>
      </body>
    </html>
    this means that all unprefixed elements are belonging to this default namespace.
    In this case an Xpath equal to '//title/text()' will not get anything because it is assuming to find the element title within a null namespace. But title in this case is automatically assigned to the default namespace.
    When you specify a prefix in a namespace then all elements without prefix are associated to namespace NULL. Using a default namespace is causing a lot of headache.
    These links can be giving a clearer picture:
    http://www.edankert.com/defaultnamespaces.html
    Assuming that you have data like this:
    WITH mydata AS
    (   SELECT '
    <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
        <title>Example XHTML document</title>
      </head>
      <body>
        <p>Sample content</p>
      </body>
    </html>' xmldata FROM DUAL
    SELECT xmltype (xmldata).EXTRACT ('//title/text()').getstringval ()
      FROM mydata;
    This query will not give anything back to you. You will have to specify:
    SELECT xmltype (xmldata).EXTRACT ('//title/text()', 'xmlns="http://www.w3.org/1999/xhtml"').getstringval ()
      FROM mydata;
    Note also that you should be able to get the default namespace when it is specified (without prefix) by using:
    SELECT xmltype(xmldata).getnamespace() from mydata;
    Post your Oracle version to see if it something related to your version. In mine I got this:
    SQL*Plus: Release 11.2.0.1.0 Production on Thu Jun 20 18:32:58 2013
    Copyright (c) 1982, 2010, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> WITH mydata AS
      2  (   SELECT '
      3  <html xmlns="http://www.w3.org/1999/xhtml">
      4    <head>
      5      <title>Example XHTML document</title>
      6    </head>
      7    <body>
      8      <p>Sample content</p>
      9    </body>
    10  </html>' xmldata FROM DUAL
    11  )
    12  SELECT xmltype(xmldata).getnamespace() from mydata;
    XMLTYPE(XMLDATA).GETNAMESPACE()
    http://www.w3.org/1999/xhtml
    SQL>
    If this would work, then it would be enough to add the optional additional parameter namespace. In case it is null it will be set as xmlsn="" and it will work anyway:
    Please note that it will work both if the XML has a default namespace or not
    i.e.:
    with default namespace:
    SQL> DECLARE
      2     xparam         XMLTYPE;
      3     v_xpath        VARCHAR2 (500);
      4     v_ns           VARCHAR2 (500);
      5  BEGIN
      6     xparam :=
      7        xmltype ('
      8  <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ns="http://www.w3.org/1999/xhtml" >
      9    <head>
    10      <title>Example XHTML document</title>
    11    </head>
    12    <body>
    13      <p>Sample content</p>
    14    </body>
    15  </html>');
    16     v_xpath := '//title/text()';
    17     v_ns := 'xmlns="' || xparam.getnamespace () || '"';
    18     DBMS_OUTPUT.
    19      put_line (
    20        'Value of title:' || xparam.EXTRACT (v_xpath, v_ns).getstringval ());
    21  END;
    22  /
    Value of title:Example XHTML document
    PL/SQL procedure successfully completed.
    SQL>
    and without default namespace
    SQL> DECLARE
      2     xparam         XMLTYPE;
      3     v_xpath        VARCHAR2 (500);
      4     v_ns           VARCHAR2 (500);
      5  BEGIN
      6     xparam :=
      7        xmltype ('
      8  <html xmlns:ns="http://www.w3.org/1999/xhtml" >
      9    <head>
    10      <title>Example XHTML document</title>
    11    </head>
    12    <body>
    13      <p>Sample content</p>
    14    </body>
    15  </html>');
    16     v_xpath := '//title/text()';
    17     v_ns := 'xmlns="' || xparam.getnamespace () || '"';
    18     DBMS_OUTPUT.
    19      put_line (
    20        'Value of title:' || xparam.EXTRACT (v_xpath, v_ns).getstringval ());
    21  END;
    22  /
    Value of title:Example XHTML document
    PL/SQL procedure successfully completed.
    Regards.
    Al
    Message was edited by: AlbertoFaenza
    IF removed as it is working anyway.

Maybe you are looking for

  • RE: Flash forms not rendering

    Anyone find a solution from Adobe regarding the MS Server 2003 problem with flash forms? Its dead on our site after the upgrade and the fixes did not work for us. http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=1&catid=143&thread

  • BW Authorization by hierarchy for 1 object/cube/query, rest unrestricted

    Hi all, I've just created my authorization object in RSECADMIN to maintain authorizations by 0PROFIT_CTR Hierarchy. This is based on a single characteristic, cube, and by technical node name. I've tested it and it seems to work fine, however, I would

  • Web galleries slow for everone else?

    Howdy all, Nobody else seems to be complaining here so maybe it's just me. I've sent out a few galleries (roughly 100 photos each) to friends and family but had nothing but complaints. First the whole browser requirements freaked them out, most just

  • CAC applet unable to find acpkcs211.dll

    I'm required to develop an applet that can call the ActivClient dll to read a CAC smartcard. I have a working console version that works perfectly as it references a locally stored config file with the following: name = myConfig library = C:\Windows\

  • Sloc change in Prod Order

    I want to change storage location (Header level. Not at component level) when i create a Production Order. I count find any ehancemnts that could meet this, any ideas would be helpful.