Extracting xmldata from clob field in oracle

I have an xml document stored in xmltype (clob)field in oracle
Below is the xml data inside the xml ( I have kind of 300 elements similar to this inside the xml)
<ns1:E-I12_IS_13 ObjID="I12" ObjType="e">5437090</ns1:E-I12_IS_13>
<ns1:E-I13_IS_14 ObjID="I13" ObjType="e">5</ns1:E-I13_IS_14>
<ns1:E-I14_IS_15 ObjID="I14" ObjType="e">9</ns1:E-I14_IS_15>
The requirement is to get all the elements from the xmldata and compare against the 15-16 oracle tables ( here xml is converted and stored in these tables by a tibco process)
select dbms_lob.instr(clobcolumnname,'E-I13_IS_14') from tablename  where  ( given condition to extract specific transaction)
the above statement gives me position of the string
select dbms_lob.substr(clobcolumnname,6( length of element value),870(position from where the value starts)) from tablename where  condition
the abv statement gives me the element value
but I want to extract the value for  any element by giving the element name ( if u see any value comes after objtype="e"  between > and < tags)
can anyone on this forum tell me to extract the element value just by giving element name ( since I have to do the same for n number of elements - how to find position of > and < tags??)

Hi Odie,
Good afternoon. I am not getting any help to solve my xmltable issues.
<MeterTransaction xmlns:CorralClub="http://webservice.hlsr.net/CorralClubService/">
  <TransactionID>1100</TransactionID>
  <Club_Number>CN001</Club_Number>
  <Club_Activity_ID>0</Club_Activity_ID>
  <Transaction_Date>2014-01-29T00:00:00-06:00</Transaction_Date>
  <Creation_Date>2014-01-29T00:00:00-06:00</Creation_Date>
  <User_ID>1766</User_ID>
  <Status />
  <TicketCount>0</TicketCount>
  <Usage>0</Usage>
  <BadPulls>0</BadPulls>
  <Discrepancy>0</Discrepancy>
  <Percent>0</Percent>
  <Comments />
  <Readings>
     ********** Can be disregarded ******************
        <xs:schema id="ClubMeter" targetNamespace="http://tempuri.org/ClubMeter.xsd" xmlns:mstns="http://tempuri.org/ClubMeter.xsd" xmlns="http://tempuri.org/ClubMeter.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-               com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">
                    ****** Some other elements
          </xs:schema>
      *********** End of Can be disregarded ******************
    <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
      <ClubMeter xmlns="http://tempuri.org/ClubMeter.xsd">
        <MeterBar diffgr:id="MeterBar1" msdata:rowOrder="0" diffgr:hasChanges="modified">
          <Club_Number>CN001</Club_Number>
          <Bar_Number>BBS01</Bar_Number>
          <TicketCount>111</TicketCount>
          <Usage>88</Usage>
          <BadPulls>15</BadPulls>
          <Discrepancy>8</Discrepancy>
          <Percent>0.0720720720720721</Percent>
          <DISPLAY>BEER - BBS01</DISPLAY>
        </MeterBar>
        <MeterBar diffgr:id="MeterBar2" msdata:rowOrder="1" diffgr:hasChanges="modified">
          <Club_Number>CN001</Club_Number>
          <Bar_Number>BBS02</Bar_Number>
          <DISPLAY>BEER - BBS02</DISPLAY>
        </MeterBar>
        <MeterReading diffgr:id="MeterReading16" msdata:rowOrder="15" diffgr:hasChanges="modified">
          <Club_Number>CN001</Club_Number>
          <Bar_Number>BBS01</Bar_Number>
          <Position>11</Position>
          <Inventory_Item_ID>12906</Inventory_Item_ID>
          <Product_Class>SOFT-GOODS</Product_Class>
          <Product_Type>SOFT DRINK</Product_Type>
          <Product_Name>Full Throttle Coca Cola</Product_Name>
          <Open>6</Open>
          <Add1>11</Add1>
          <Close>1</Close>
          <Usage>16</Usage>
        </MeterReading>
        <MeterReading diffgr:id="MeterReading96" msdata:rowOrder="95" diffgr:hasChanges="modified">
          <Club_Number>CN001</Club_Number>
          <Bar_Number>BBS01</Bar_Number>
          <Position>10</Position>
          <Inventory_Item_ID>2188</Inventory_Item_ID>
          <Product_Class>BEER</Product_Class>
          <Product_Type>DOMESTIC</Product_Type>
          <Product_Name>Lone Star Regular</Product_Name>
          <Open>6</Open>
          <Add1>2</Add1>
          <Close>1</Close>
          <BadPulls>3</BadPulls>
          <Usage>4</Usage>
        </MeterReading>
        <MeterReading diffgr:id="MeterReading17" msdata:rowOrder="16" diffgr:hasChanges="modified">
          <Club_Number>CN001</Club_Number>
          <Bar_Number>BBS02</Bar_Number>
          <Position>11</Position>
          <Inventory_Item_ID>12906</Inventory_Item_ID>
          <Product_Class>SOFT-GOODS</Product_Class>
          <Product_Type>SOFT DRINK</Product_Type>
          <Product_Name>Full Throttle Coca Cola</Product_Name>
        </MeterReading>
        <MeterReading diffgr:id="MeterReading97" msdata:rowOrder="96" diffgr:hasChanges="modified">
          <Club_Number>CN001</Club_Number>
          <Bar_Number>BBS02</Bar_Number>
          <Position>10</Position>
          <Inventory_Item_ID>2188</Inventory_Item_ID>
          <Product_Class>BEER</Product_Class>
          <Product_Type>DOMESTIC</Product_Type>
          <Product_Name>Lone Star Regular</Product_Name>
        </MeterReading>
      </ClubMeter>
      <diffgr:before>
        <MeterBar xmlns="http://tempuri.org/ClubMeter.xsd" diffgr:id="MeterBar1" msdata:rowOrder="0">
          <Bar_Number>BBS01</Bar_Number>
          <DISPLAY>BEER - BBS01</DISPLAY>
        </MeterBar>
        <MeterBar xmlns="http://tempuri.org/ClubMeter.xsd" diffgr:id="MeterBar2" msdata:rowOrder="1">
          <Bar_Number>BBS02</Bar_Number>
          <DISPLAY>BEER - BBS02</DISPLAY>
        </MeterBar>
        <MeterReading xmlns="http://tempuri.org/ClubMeter.xsd" diffgr:id="MeterReading16" msdata:rowOrder="15">
          <Bar_Number>BBS01</Bar_Number>
          <Position>11</Position>
          <Inventory_Item_ID>12906</Inventory_Item_ID>
          <Product_Class>SOFT-GOODS</Product_Class>
          <Product_Type>SOFT DRINK</Product_Type>
          <Product_Name>Full Throttle Coca Cola</Product_Name>
        </MeterReading>
        <MeterReading xmlns="http://tempuri.org/ClubMeter.xsd" diffgr:id="MeterReading96" msdata:rowOrder="95">
          <Bar_Number>BBS01</Bar_Number>
          <Position>10</Position>
          <Inventory_Item_ID>2188</Inventory_Item_ID>
          <Product_Class>BEER</Product_Class>
          <Product_Type>DOMESTIC</Product_Type>
          <Product_Name>Lone Star Regular</Product_Name>
        </MeterReading>
        <MeterReading xmlns="http://tempuri.org/ClubMeter.xsd" diffgr:id="MeterReading17" msdata:rowOrder="16">
          <Bar_Number>BBS02</Bar_Number>
          <Position>11</Position>
          <Inventory_Item_ID>12906</Inventory_Item_ID>
          <Product_Class>SOFT-GOODS</Product_Class>
          <Product_Type>SOFT DRINK</Product_Type>
          <Product_Name>Full Throttle Coca Cola</Product_Name>
        </MeterReading>
        <MeterReading xmlns="http://tempuri.org/ClubMeter.xsd" diffgr:id="MeterReading97" msdata:rowOrder="96">
          <Bar_Number>BBS02</Bar_Number>
          <Position>10</Position>
          <Inventory_Item_ID>2188</Inventory_Item_ID>
          <Product_Class>BEER</Product_Class>
          <Product_Type>DOMESTIC</Product_Type>
          <Product_Name>Lone Star Regular</Product_Name>
        </MeterReading>
      </diffgr:before>
    </diffgr:diffgram>
  </Readings>
</MeterTransaction>
From the above abbreviated XML document, how do I get the values from the nodes of MeterBar and MeterReading nodes?
I really appreciate your help in this regard.
Thanks,
Bidhan

Similar Messages

  • How to parse/extract XML from clob field using ODI

    Hi,
    I am very new to ODI. I have an oracle table which has clob field. This clob field contains xml. I would like to parse this xml and convert it to oracle table. Means I would like to make all the tags of xml as oracle table columns.
    I have created a PL/SQL procedure and used XMLTABLE function and I have achieved my goal. The same this I am trying to do with ODI. Since I am new to ODI so any help is appreciated.
    Thanks

    In 9.2, you are limited into your options. Have a look into, among others, updateXML. Updating tp 10gR2 will give you more options to succeed.

  • Parse XML from CLOB field

    How can I parse XML from CLOB field? I need to replace or delete the node from XML document and update the database with new XML. I am using Oracle 9i release 2.
    Here is the XML. In this XML if section1 and section2 exists then I need to delete the section1 node. If section2 doesn't exist, replace section1 with section2 node.
    <Document ID='2' TypeID='2'>
    <Body>
    <Page Name='Page1'>
    <Sec ID='section1' Title='Section 1' GroupID='' />
    <Sec ID='section2' Title='Section 2' GroupID='' />
    </Page>
    </Body>
    </Document>
    Please help.. Thank you..

    In 9.2, you are limited into your options. Have a look into, among others, updateXML. Updating tp 10gR2 will give you more options to succeed.

  • How to extract data from the fields present in two or three tables

    Hi Experts,
          I have a scenario where i have to extract data from the fields of different tables. e.g. let there 2 tables which have some number of fields . I want the data of 3 fields each from these 2 tables. How can i get that??
    Sam

    Hi
    You can create view in tcode se11..
    here you include all tables from which you want to fetch the data..
    you need to give selection condition here
    eg..
    say select empname from table A, select empadd from table B.. where empno(from A)=empno(from B)
    (note that you dont need to write queries like this.. i have just given u the example)
    After creating the view you can create datasource in RSO2..
    Regards
    Swati

  • Inserting to a CLOB field in Oracle 8i  Database

    Hi All,
    I am trying to insert a value to a CLOB field in Oracle 8i DB.
    The value gets inserted when the size is less (Up to around 80 Bytes).
    When the size becomes larger the insertion does not take place but no exception is thrown.
    Please see below the code I have written.
    PreparedStatement preparedStatement = null;
              try {
                   connection = getConnection(MMAKeys.WMDS_DATASOURCE);
                   String query = "UPDATE s_mmhp_batch SET MMHP_REPORT_CLOB=(?) WHERE MMHP_BATCH_ID=(?) AND MMHP_USER_ID=(?) AND MMHP_MEMBER_KEY=(?)";
              preparedStatement=connection.prepareStatement(query);
              Reader r = new StringReader(clobReport);
              preparedStatement.setCharacterStream(1, r, clobReport.length());
              oracle.sql.CLOB newClob = oracle.sql.CLOB.createTemporary(connection , false, oracle.sql.CLOB.DURATION_CALL);
              newClob.putString(1,clobReport);
              preparedStatement.setClob(1,newClob);
              preparedStatement.setInt(2,batchId);
              preparedStatement.setString(3,userId);
              preparedStatement.setString(4,memberKey);
              preparedStatement.executeUpdate();
              System.out.println("inside the write to Batch method after executing the query");
              } catch (SQLException exception) {
                   throw new DAOException(
                        "MREDMMSDAO -> writeToTable():SQLException"
                             + exception.getMessage());
              } catch (Exception exception) {
                   throw new DAOException(
                        "MREDMMSDAO -> writeToTable():Exception"
                             + exception.getMessage());
              } finally {
                   closeStatement(preparedStatement);
                   closeConnection(connection);
    I came to know that this method is not supported in Oracle 8i.
    I tried to create an empty CLOB and call the putValue() method.
    But Then, I got an exception stating that the method is not supported.
    Is there any other way to insert a CLOB value to Oracle 8i?
    Please help.
    Thanks in advance,
    Neelambary

    And cursor.callproc('insert_clob_proc', (clob,))
    doesn't work for you?
    PrzemekYes - I should have been more clear in my original post. The callproc function works until we have a value which is over 32K. At values over 32K, we get an error message "ORA-01460: unimplemented or unreasonable conversion requested". I believe this is because we are sending the value as a string and so we would need to figure out how to send as a CLOB in cx_Oracle? Here is some code to use to test if interested...
    Oracle (Oracle Database 10g Release 10.1.0.4.0 - Production):
    CREATE TABLE clob_test (CLOB_FIELD CLOB);
    CREATE OR REPLACE PROCEDURE ins_clob_test (v_clob_field IN CLOB)
    AS
    BEGIN
    INSERT INTO clob_test (clob_field) VALUES (v_clob_field);
    END ins_clob_test;
    Python (2.5):
    conn = cx_Oracle.connect(xhash['oraclelogin'])
    cursor = conn.cursor()
    clob_var = 'Some test data' * 10000
    cursor.callproc('ins_clob_test',(clob_var,))
    conn.commit()
    cursor.close()
    conn.close()
    I should also mention that I am the Oracle developer and not the Python programmer - my knowledge of Python is very limited. I would like the Python programmers to use the procedures (packages) I have created to do their inserts but this situation has caused them to put the SQL directly in their code.
    Thanks again for any assistance you can provide.
    Jason

  • 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.

  • Problems While Extracting Hours From Date Field

    Hi Guys,
    Hope you are doing well.
    I am facing some problems while extracting hours from date field. Below is an example of my orders table:-
    select * from orders;
    Order_NO     Arrival Time               Product Name
    1          20-NOV-10 10:10:00 AM          Desktop
    2          21-NOV-10 17:26:34 PM          Laptop
    3          22-JAN-11 08:10:00 AM          Printer
    Earlier there was a requirement that daily how many orders are taking place in the order's table, In that I used to write a query
    arrival_time>=trunc((sysdate-1),'DD')
    and arrival_time<trunc((sysdate),'DD')
    The above query gives me yesterday how many orders have been taken place.
    Now I have new requirement to generate a report on every 4 hours how many orders will take place. For an example if current time is 8.00 AM IST then the query should fetch from 4.00 AM till 8 AM how many orders taken place. The report will run next at 12.00 PM IST which will give me order took place from 8.00 AM till 12.00 PM.
    The report will run at every 4 hours a day and generate report of orders taken place of last 4 hours. I have a scheduler which will run this query every hours, but how to make the query understand to fetch order details which arrived last 4 hours. I am not able to achieve this using trunc.
    Can you please assist me how to make this happen. I have checked "Extract" also but I am not satisfied.
    Please help.
    Thanks In Advance
    Arijit

    you may try something like
    with testdata as (
      select sysdate - level/24 t from dual
      connect by level <11
    select
      to_char(sysdate, 'DD-MM-YYYY HH24:MI:SS') s
    , to_char(t, 'DD-MM-YYYY HH24:MI:SS') t from testdata
    where
    t >= trunc(sysdate, 'HH') - numtodsinterval(4, 'HOUR')
    S     T
    19-06-2012 16:08:21     19-06-2012 15:08:21
    19-06-2012 16:08:21     19-06-2012 14:08:21
    19-06-2012 16:08:21     19-06-2012 13:08:21
    19-06-2012 16:08:21     19-06-2012 12:08:21trunc ( ,'HH') truncates the minutes and seconds from the date.
    Extract hour works only on timestamps
    regards
    Edited by: chris227 on 19.06.2012 14:13

  • Issue related with CLOB field in Oracle and PI

    Dear Experts,
    We are trying to transfer material Long description from SAP to Oracle table.
    There is a field in Oracle table 'LNG_DESC' which is defined as CLOB.
    In PI mapping we have defined that fields as String type with Maxlength as 14000.
    There are few materials for which this limit is excedding and we are getting ORA:014
    String too Long' error in communication channel.
    Kindly suggest that how can we define a field in PI as CLOB or how to handle this
    situation.
    Thanks
    Sumit

    Hi Hank,
    The reason could be either improper set up and loading sequence followed, or transactions not locked while performing set up filling and initialization.
    There could be two approaches to rectify this.
    1. Redo the inventory data, as per how to document.
    2. Identify the transactions that are not captured, by running the reports and analysing the date on which transactions are not captured(this could be quite painful) and then fill set up of movements just for these documents and load to cube without discurbing the deltas.
    Do write back to me, if you have any questions.
    Naveen

  • Extracting data from XMLType field

    Sorry, I don't know XMLQuery very well, this is probably a simple question.  I'm trying to extract data into a tablular form from an XMLTYPE field.  I'll use the following example to illustrate my question:
    WITH a as (
    select xmltype('
    <bugStatus>
      <status>
        <bugCode>111</bugCode>
        <bug number="12345" description="Low severity bug"/>
      </status>
      <status>
        <bugCode>222</bugCode>
        <bug number="67890" description="High severity bug"/>
      </status>
    </bugStatus>
    ') xmldata from dual)
    SELECT x.*
    FROM a, xmltable('bugStatus/status'
       passing a.xmldata columns
       status_code number path 'bugCode'
    ) x;
    Running that code block extracts the "bugCode" fields successfully.  But I'd like to also similarly extract the "bug number" and "description" fields.  Ideally as independent columns.  But even if only as a single line showing "bug number=.... description=....." I could then still parse it with SQL.
    Can someone please point me in the right direction of how I can also extract that additional data?
    Thanks!

    Thanks Marco, that was a great and simple solution to my original question.
    However let me change the data slightly.  I've tried to do something similar with this slightly modified XML data and I think I'm close, but not quite there.  Can you assist with this new scenario?
    WITH a as (
    select xmltype('
    <bugStatus>
       <bugCode REF_ID="XYZ">
          <status>
              <bug number="12345" description="Low severity bug"/>
              <bug number="67890" description="High severity bug"/>
          </status>
       </bugCode>
    </bugStatus>
    ') xmldata from dual)
    SELECT /*x.bugCode,*/ y.bugNumber, y.bugDescription
    FROM a,
         xmltable('/bugStatus'
            PASSING a.xmldata
            COLUMNS
               bugCode char(3) path 'bugCode/@REF_ID',
               mystatus xmltype path 'bugCode/status'
         ) x,
         xmltable('/status'
            PASSING x.mystatus
            COLUMNS
               --row_number for ordinality,
               bugNumber number path 'bug/@number',
               bugDescription varchar2(80) path 'bug/@description'
         ) y;
    I think I'm close on this one but still getting the error:
    ORA-19279: XPTY0004 - XQuery dynamic type mismatch: expected singleton sequence - got multi-item sequence
    Thank you!

  • Parsing text from CLOB field that's stored as XML

    I have a CLOB field that contains an XML string. That looks like the text below. Is it possible to parse out the text string Denied NOW!!!. I basically want to parse out the data between the first encounter of the <CommentBody> tag.
    <CommentHeader>Whatever<CommentDate>2010-01-21-15.16.48.000000
    </CommentDate></CommentHeader><CommentBody>Denied NOW!!!</CommentBody>
    <CommentHeader>Whatever<CommentDate>2010-01-21-15.10.38.000000
    </CommentDate></CommentHeader><CommentBody>Denied YESTERDAY!!!</CommentBody>
    Thanks all!!
    Edited by: user11938977 on Jun 28, 2010 11:32 AM

    Thanks everyone! I'm using Oracle 11.1.0.7.0
    It seems to work as long as the Text Contents of CommentBody tag is one word without spaces. If there are spaces in between the tags it errors out. Here's the SQL:
    SELECT extractvalue( xmltype('<root>'||t.comments||'</root>'),
    'root/CommentBody[1]' ) as "CommentBody"
    FROM AP_VCHR_AW t
    When COMMENTS contains this data it errors out:
    <CommentHeader> <CommentDate>2010-03-04-17.52.53.000000
    </CommentDate></CommentHeader><CommentBody>This is an approved vuocher</CommentBody>
    <CommentHeader> <CommentDate>2010-03-04-17.52.53.000000
    </CommentDate></CommentHeader><CommentBody>This is an approved vuocher</CommentBody>
    When COMMENTS contains this data the SQL succeeds:
    <CommentHeader>at <CommentDate>2010-01-21-15.16.48.000000
    </CommentDate></CommentHeader><CommentBody>Denied!!!</CommentBody>
    <CommentHeader> at <CommentDate>2010-01-21-15.10.38.000000
    </CommentDate></CommentHeader><CommentBody>Denied!!!</CommentBody>

  • How to extract data from CLOB Datatype having XML values

    Hi,
    I am facing problem in extracting data from a TAble FCT_A where OBJECT_CONTENT field(Datatype CLOB) is having data of XML type.
    Below are the value:
    <ras-cube>
    <jndiDataSourceName>datasource_etl</jndiDataSourceName>
    <dimensions class="vector">
    <string>CUG_IND</string>
    <string>EVENT_DATE</string>
    <string>EVENT_DIRECTION_KEY</string>
    <string>EVENT_TIME_SLOT_KEY</string>
    <string>EVENT_TYPE_KEY</string>
    <string>FAF_IND</string>
    <string>FILTERED_OUT_FLAG</string>
    <string>IN_TG_ID_KEY</string>
    <string>LONG_EVENT_IND</string>
    <string>NE_ID_KEY</string>
    <string>NODE_ADDRESS</string>
    <string>OTHER_MSISDN_DIAL_DIGIT_KEY</string>
    <string>OUT_TG_ID_KEY</string>
    <string>RATING_DELAY_IND</string>
    <string>RI_MISMATCH_IND</string>
    <string>SERVED_MSISDN_DIAL_DIGIT_KEY</string>
    <string>SERVED_MSRN_DIAL_DIGIT_KEY</string>
    <string>SRV_TYPE_KEY</string>
    <string>SUBS_BU_KEY</string>
    <string>SYS_ID_KEY</string>
    <string>TERMINATION_REASON_KEY</string>
    <string>THIRD_PARTY_DIAL_DIGIT_KEY</string>
    <string>ZERO_FLAG_KEY</string>
    </dimensions>
    <measures class="vector">
    <com.connectiva.onereview.rasobjects.cube.CubeMeasure>
    <targetName>CHARGE</targetName>
    <expression>SUM(FCT_RATED.CHARGE)</expression>
    <persist>true</persist>
    </com.connectiva.onereview.rasobjects.cube.CubeMeasure>
    <com.connectiva.onereview.rasobjects.cube.CubeMeasure>
    <targetName>COMPUTED_VOLUME</targetName>
    <expression>SUM(FCT_RATED.COMPUTED_VOLUME)</expression>
    <persist>true</persist>
    </com.connectiva.onereview.rasobjects.cube.CubeMeasure>
    <com.connectiva.onereview.rasobjects.cube.CubeMeasure>
    <targetName>DOWNLINK_VOLUME</targetName>
    <expression>SUM(FCT_RATED.DOWNLINK_VOLUME)</expression>
    <persist>true</persist>
    </com.connectiva.onereview.rasobjects.cube.CubeMeasure>
    <com.connectiva.onereview.rasobjects.cube.CubeMeasure>
    <targetName>ORIGINAL_DUR</targetName>
    <expression>SUM(FCT_RATED.ORIGINAL_DUR)</expression>
    <persist>true</persist>
    </com.connectiva.onereview.rasobjects.cube.CubeMeasure>
    <com.connectiva.onereview.rasobjects.cube.CubeMeasure>
    <targetName>RA_CHARGE</targetName>
    <expression>SUM(FCT_RATED.RA_CHARGE)</expression>
    <persist>true</persist>
    </com.connectiva.onereview.rasobjects.cube.CubeMeasure>
    <com.connectiva.onereview.rasobjects.cube.CubeMeasure>
    <targetName>RECORD_COUNT</targetName>
    <expression>COUNT(FCT_RATED.*)</expression>
    <persist>true</persist>
    </com.connectiva.onereview.rasobjects.cube.CubeMeasure>
    <com.connectiva.onereview.rasobjects.cube.CubeMeasure>
    <targetName>UPLINK_VOLUME</targetName>
    <expression>SUM(FCT_RATED.UPLINK_VOLUME)</expression>
    <persist>true</persist>
    </com.connectiva.onereview.rasobjects.cube.CubeMeasure>
    </measures>
    <dimensionMap class="linked-hash-map">
    <entry>
    <string>FCT_RATED</string>
    <null/>
    </entry>
    </dimensionMap>
    <cubeStorageConfig>
    <partitionColumn>EVENT_DATE</partitionColumn>
    <tableSpaceName>ORV5_ETL_DFLT</tableSpaceName>
    <isLogging>false</isLogging>
    <isCompressed>false</isCompressed>
    <noOfHashPartition>10</noOfHashPartition>
    <partitionScheme>1</partitionScheme>
    </cubeStorageConfig>
    <cubeType>1</cubeType>
    <name>MX_RATED</name>
    <label></label>
    <parentNames>
    <string>FCT_RATED</string>
    </parentNames>
    <otherProperties class="linked-hash-map"/>
    </ras-cube>
    I want to extract expression tag in the above XML types
    Kindly any help will be needful for me
    Thanks and Regards

    9i
    with FCT_A as (
    select xmltype('
    <ras-cube>
    <jndiDataSourceName>datasource_etl</jndiDataSourceName>
    <dimensions class="vector">
    <string>CUG_IND</string>
    <string>EVENT_DATE</string>
    <string>EVENT_DIRECTION_KEY</string>
    <string>EVENT_TIME_SLOT_KEY</string>
    <string>EVENT_TYPE_KEY</string>
    <string>FAF_IND</string>
    <string>FILTERED_OUT_FLAG</string>
    <string>IN_TG_ID_KEY</string>
    <string>LONG_EVENT_IND</string>
    <string>NE_ID_KEY</string>
    <string>NODE_ADDRESS</string>
    <string>OTHER_MSISDN_DIAL_DIGIT_KEY</string>
    <string>OUT_TG_ID_KEY</string>
    <string>RATING_DELAY_IND</string>
    <string>RI_MISMATCH_IND</string>
    <string>SERVED_MSISDN_DIAL_DIGIT_KEY</string>
    <string>SERVED_MSRN_DIAL_DIGIT_KEY</string>
    <string>SRV_TYPE_KEY</string>
    <string>SUBS_BU_KEY</string>
    <string>SYS_ID_KEY</string>
    <string>TERMINATION_REASON_KEY</string>
    <string>THIRD_PARTY_DIAL_DIGIT_KEY</string>
    <string>ZERO_FLAG_KEY</string>
    </dimensions>
    <measures class="vector">
    <com.connectiva.onereview.rasobjects.cube.CubeMeasure>
    <targetName>CHARGE</targetName>
    <expression>SUM(FCT_RATED.CHARGE)</expression>
    <persist>true</persist>
    </com.connectiva.onereview.rasobjects.cube.CubeMeasure>
    <com.connectiva.onereview.rasobjects.cube.CubeMeasure>
    <targetName>COMPUTED_VOLUME</targetName>
    <expression>SUM(FCT_RATED.COMPUTED_VOLUME)</expression>
    <persist>true</persist>
    </com.connectiva.onereview.rasobjects.cube.CubeMeasure>
    <com.connectiva.onereview.rasobjects.cube.CubeMeasure>
    <targetName>DOWNLINK_VOLUME</targetName>
    <expression>SUM(FCT_RATED.DOWNLINK_VOLUME)</expression>
    <persist>true</persist>
    </com.connectiva.onereview.rasobjects.cube.CubeMeasure>
    <com.connectiva.onereview.rasobjects.cube.CubeMeasure>
    <targetName>ORIGINAL_DUR</targetName>
    <expression>SUM(FCT_RATED.ORIGINAL_DUR)</expression>
    <persist>true</persist>
    </com.connectiva.onereview.rasobjects.cube.CubeMeasure>
    <com.connectiva.onereview.rasobjects.cube.CubeMeasure>
    <targetName>RA_CHARGE</targetName>
    <expression>SUM(FCT_RATED.RA_CHARGE)</expression>
    <persist>true</persist>
    </com.connectiva.onereview.rasobjects.cube.CubeMeasure>
    <com.connectiva.onereview.rasobjects.cube.CubeMeasure>
    <targetName>RECORD_COUNT</targetName>
    <expression>COUNT(FCT_RATED.*)</expression>
    <persist>true</persist>
    </com.connectiva.onereview.rasobjects.cube.CubeMeasure>
    <com.connectiva.onereview.rasobjects.cube.CubeMeasure>
    <targetName>UPLINK_VOLUME</targetName>
    <expression>SUM(FCT_RATED.UPLINK_VOLUME)</expression>
    <persist>true</persist>
    </com.connectiva.onereview.rasobjects.cube.CubeMeasure>
    </measures>
    <dimensionMap class="linked-hash-map">
    <entry>
    <string>FCT_RATED</string>
    <null/>
    </entry>
    </dimensionMap>
    <cubeStorageConfig>
    <partitionColumn>EVENT_DATE</partitionColumn>
    <tableSpaceName>ORV5_ETL_DFLT</tableSpaceName>
    <isLogging>false</isLogging>
    <isCompressed>false</isCompressed>
    <noOfHashPartition>10</noOfHashPartition>
    <partitionScheme>1</partitionScheme>
    </cubeStorageConfig>
    <cubeType>1</cubeType>
    <name>MX_RATED</name>
    <label></label>
    <parentNames>
    <string>FCT_RATED</string>
    </parentNames>
    <otherProperties class="linked-hash-map"/>
    </ras-cube>') OBJECT_CONTENT from dual
    SELECT   EXTRACTVALUE(value(d), '//expression/text()', '') exp
    FROM     fct_a t,
             TABLE(XMLSEQUENCE(EXTRACT (
                                 t.object_content,
                                 '//ras-cube/measures/com.connectiva.onereview.rasobjects.cube.CubeMeasure/expression'
                               ))) dEdited by: Beijing on Aug 10, 2009 9:21 AM

  • Extracting Data From a Table in Oracle

    How would one extract the data from a table in oracle and put in ascii format file?
    Do you use sql loader?

    http://asktom.oracle.com/pls/ask/f?p=4950:8:6139291395251309702::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:68212348056,
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:464420312302

  • Extracting data from a field

    Hi,
    I have a comment field with manay information on it. One record will have text and date and numbers to it. I would like to pull the codes from 1001, 1002 up to 1012 from the field. Example comment:
    1. 1005 9-30-09 update only
    2. EDC 1008 9-15-09 changes
    I would like to extract the data 1005 and add in a separate column or create a new field for Code. The second example, I would like to get the data 1008. The date that follows the number 1005 in example 1, I also would like to put in another field called Received Date except for codes 1001 - 1004.
    Can you please give me suggestions on  how to handle this? I am using Crystal 10.
    Thank you!

    Marinette,
    Try this:
    left(right(split({field},'-')[1],5),4)
    I hope that helps,
    Regards,
    Zack H.

  • Read data from CLOB field

    Hello,
    I have table ( table1 ) with clob field ( clob1 ).
    Content of clob1 field is :
    data01 data02 data03 12345 data04
    data05 data06 data07 32131 data08
    data09 data10 data11 43422 data12
    data13 data14 data15 54534 data16
    Content of clob1 field is imported from ASCII file. Number of records in ASCII file is variable.
    How can I read each row separately from clob1 field?
    Thanks

    Here is an example of how it can be done.
    Note you will have to have an end of line marker on each line including the last line.
    In my case I have used the '@' symbol as a line delimiter
    declare
    v_clob clob := 'This is my@clob string which@is over a number@of lines@';
    v_clob_length number;
    v_read_pos number := 1;
    v_subclob clob;
    v_line varchar2(4000);
    v_marker number;
    begin
    v_clob_length := dbms_lob.getlength(v_clob);
    while  v_read_pos <= v_clob_length
    loop
    v_subclob := empty_clob();
    -- make a clob of the smaller piece of data
    v_subclob := dbms_lob.substr(v_clob,v_clob_length,v_read_pos);
    -- find the position of the end of line marker
    v_marker  := dbms_lob.instr(v_subclob,'@');
    -- build a line from the subclob, removing the trailing end of line marker
    v_line    := dbms_lob.substr(v_subclob,v_marker-1,1);
    dbms_output.put_line(v_line);
    --  increment the position from where to start reading the original clob
    v_read_pos := v_read_pos+length(v_line)+1;
    end loop;
    end;This produces the following
    This is my
    clob string which
    is over a number
    of lines

  • How to retrieve and use an XSL file from CLOB field

    I am using Java to query my data and return XML formatted data. I am able to format this data using an XSLStylesheet file. But I want to instead use an XSL Stylesheet stored in a clob field.
    I have an XSL file stored in a clob field. How can I retrieve and use it to initialize an XMLDocument and then create an XSLStylesheet.
    Thanks for your help,
    Les Smith

    I think this question has been raised before. Try searching this forum.

Maybe you are looking for

  • Is there a way to *disable* tv-out on ipod touch?

    I just upgraded from a regular ipod classic to the new touch. I had one of those Peripheral ipod kits in the car, and my son likes to watch movies on our longer drives to the grandparents every weekend. Anyway, got this new ipod touch, which blocks o

  • Mac Pro early 2008 boots to black screen

    Four times out of five, on average, the Mac boots to a black screen -- a 30" Cinema Display. I believe the computer is booting all the way up, because I have the front power button set to put the computer to sleep, and when I manually power down the

  • Sequence of process types in process chains

    Hi all, Can any one help me in listing down the sequence of process types we must have when we are using process chains. Like If I am loading data from R/3 to ODS and to cube then what all things should be included (creating indexex, deleting indexes

  • What are good apps

    i am a software whore and wish to sleep with all the open source i can get a hold of. but theres a lot to go through and i don't have the stamina. what are some of your favorate lesser known works of code art i'd put engage and mpd on my list and wou

  • Uninstall Submerge

    I downloaded this program when looking for a subtitle program but don't need it afterall.  All of my video downloads (mp4) from Youtube have been converted and now play in Submerge instead of Quicktime like before the Submerge download.  I don't want