Any_help_with_this_xmlquerry

How do you count the datatype date using extract,extractvalue for xpath or xmlquery
in PL/SQL from the following xml file:
<conditions month="November 2005">
<date day="02">
     <orientation rose="S">
<height unit="cm">3</height>
<quality>sping</quality>
</orientation>
     <orientation rose="N">
<height unit="cm">10</height>
<quality>easy</quality>
</orientation>
     <orientation rose="W">
<height unit="cm">7</height>
<quality>spring</quality>
</orientation>
     <orientation rose="E">
<height unit="cm">10</height>
<quality>spring</quality>
</orientation>
</date>
<date day="03">
-<orientation rose="S">
<change unit="cm">10</change>
<quality>hard</quality>
</orientation>
-<orientation rose="N">
<change unit="cm">15</change>
<quality>hard</quality>
</orientation>
-<orientation rose="W">
<change unit="cm">15</change>
<quality>hard</quality>
</orientation>
-<orientation rose="E">
<change unit="cm">15</change>
<quality>hard</quality>
</orientation>
</date>
</conditions>
Any help on this..
thanks in advance

is this what you want ?
SQL> create table xml_table(xml_data xmltype)
  2  /
Table created.
SQL> insert into xml_table values(xmltype
  2  ('<conditions month="November 2005">
  3   <date day="02">
  4    <orientation rose="S">
  5     <height unit="cm">3</height>
  6     <quality>sping</quality>
  7    </orientation>
  8    <orientation rose="N">
  9     <height unit="cm">10</height>
10     <quality>easy</quality>
11    </orientation>
12    <orientation rose="W">
13     <height unit="cm">7</height>
14     <quality>spring</quality>
15    </orientation>
16    <orientation rose="E">
17     <height unit="cm">10</height>
18     <quality>spring</quality>
19    </orientation>
20   </date>
21   <date day="03">
22    <orientation rose="S">
23     <change unit="cm">10</change>
24     <quality>hard</quality>
25    </orientation>
26    <orientation rose="N">
27     <change unit="cm">15</change>
28     <quality>hard</quality>
29    </orientation>
30    <orientation rose="W">
31     <change unit="cm">15</change>
32     <quality>hard</quality>
33    </orientation>
34    <orientation rose="E">
35     <change unit="cm">15</change>
36     <quality>hard</quality>
37    </orientation>
38   </date>
39  </conditions>'))
40  /
1 row created.
SQL>
SQL> select count(extract(value(x), '/date')) date_count
  2  from xml_table
  3  , table(xmlsequence(extract(xml_Data, '/conditions/date'))) x
  4  /
DATE_COUNT                                                                                                                                           
         2                                                                                                                                           

Similar Messages

Maybe you are looking for

  • Apache Plugin is not working with Cluster Entry in httpd.conf

    Hi Guys, We have a very particular issue that is happening here in our production environments. Before explaining the issue to you, I will just give a brief of our architecture. We are using Weblogic Portal Platform SP4. Our current Production Domain

  • New memory leak with CS4 update?

    I just downloaded the CS4 update last night, and was doing my normal photoshop work when I had to re-start the application due to what looks like a memory leak. Windows XP, 3GHZ dual core ( 45 nm one ), 4 GB RAM, NVidia 9600 GT, no GPU enabled ( stil

  • Java.io.IOException: FRM-93000: Unexpected internal error.

    Hi Exprerts, I have noticed the below errors in the application log file on my production instance. E Business Suit = R12.1.1 + 11.1.0.7 Application Log - /rsv/d02/inst/apps/PROD_oro/logs/ora/10.1.3/j2ee/forms/forms_default_group_1 13/02/21 13:36:44.

  • How do I import photos in my iBook Library to my G5 Library w/ album names?

    I want to combine my iBook Library with my G5 Library. They are connected via a wireless network. What is the easist way to do this? Thanks for the info Len

  • Sccm 2007 Hardware inventory report

    Dear Exprt, How do i ensure SCCM client has seccessfully send H/W inventory report to MP with out any issue and when. i have look the (InventoryAgent.log) and it did writen (Inventory: Successfully sent report. Destination:mp:MP_HinvEndpoint) but not