How to read XML data stored in CLOB in Concurrent prog Output

Hi All,
I'm trying to Generate the XML Data as concurrent Program output. I have a PL/SQL package which generated the XML data by using SQL/XML functions. I'm storing the generated XML data in a CLOB variable. But when i try to read the data using fnd_file.put_line(fnd_file.OUTPUT,XML_Data) it doesn't display data more than 32767 bytes.
Please help me out to understand what could be done to read the data in chunks. I have tried many logic's to print chunks of data but the output tags are either chopped off and errors out saying Tag not found.
My logic is as below:
v_handler:= DBMS_XMLGEN.newContext(v_xml_query);
--Sets NULL handling options
DBMS_XMLGen.SetNullHandling(v_handler, dbms_xmlgen.EMPTY_TAG ) ;
--Set special character handling
DBMS_XMLGEN.setConvertSpecialChars(v_handler, TRUE);
-- Specified whether to use an XML attribute to indicate NULLness of particular entity in the XML document
DBMS_XMLGen.useNullAttributeIndicator(v_handler,TRUE);
-- set Checking invalid chars
DBMS_XMLGEN.setCheckInvalidChars(v_handler, TRUE);
-- get the xml data as required
v_xml_data:= DBMS_XMLGEN.getXMLtype(v_handler);
SELECT XMLROOT(v_xml_data.extract('/*'),VERSION '1.0').getClobVal() into v_new_xml_Data from dual;
-- get the length of the xml generated
v_clob_len := dbms_lob.getlength(v_new_xml_Data);
FND_FILE.PUT_LINE(FND_FILE.LOG,'The Clob length is :'|| v_clob_len);
-- logic to process string more than 32767 Processing by each character
v_offset :=1;
while (v_offset <= v_clob_len)
LOOP
v_char := dbms_lob.substr(v_new_xml_Data, 1, v_offset);
IF (v_char = CHR(10))
then
fnd_file.new_line(fnd_file.output, 1);
else
fnd_file.put(fnd_file.output, v_char);
end if;
v_offset := v_offset + 1;
END LOOP;
FND_FILE.PUT_LINE(FND_FILE.LOG,'The offset is :'|| v_offset);
FND_FILE.NEW_LINE(FND_FILE.OUTPUT, 1);
THe above logic is for character by character which is a performance burden? Please let me know if there is any other work around for this

Hi,
Thanks for Replying. I have refered http://blog.oraclecontractors.com/?p=69 and then i added that piece of code. Basically, i'm trying to generate a report using XML publisher. To generate the XML data i'm writing a pl/sql package with SQl/XML functions. DBMS_XMLGEN would help me convert the XML Data as is. When the concurrent program runs this XML data will merge with RTF layout and generate required report. I'm able to generate the Report for data less then 32767 bytes. More than the limit i need to pass chunks of XML data to read as output. That's the reason i'm using fnd_file.output. But it reads only 32767 size at a time.
WHen i use the given logic, it works perfectly fine, but it loops for each character, for example if you have 30,000 characters it loops the same, which is peformance burden.
So i tried to write the logic of chunks but still i get the error that XML tag is not found or missing. I'm hoping this is very common issue, but after all my trails, i didn't find the right solution.
the other logic i tried was :
v_new_xml_data varchar2(32767)
v_iterations := CEIL(v_clob_len/v_chunk_length); -- v_chunk_length is 32767 and v_clob_length is length of the XML data stored inthe clob variable
For i in 0..v_iterations
LOOP
FND_FILE.put_line (fnd_file.log,'the loops v_pos :'||i||' and v_clob_length :'||v_clob_len);
v_new_xml_data := DBMS_LOB.SUBSTR ( V_XML_DATA,v_chunk_length,(i*v_chunk_length)+1);
FND_FILE.PUT_LINE (FND_FILE.OUTPUT,v_new_xml_data); -- read the output for every 32767 chunks
FND_FILE.PUT_LINE(FND_FILE.LOG, 'Chunk length is :'||((i*v_chunk_length)+1));
END LOOP;
FND_FILE.put_line (fnd_file.log,'out of loop');
FND_FILE.put_line (fnd_file.log,'length of new xml is '||v_clob_len);
Please, let me know if you need Further clarifications on the same.

Similar Messages

  • How to read XML Data stored as Clob

    Hi
    I am new to clob & XML types...
    An XML data has been inserted into a Clob field in a Oracle(9.2.0.8.0) Table
    CREATE TABLE TEMP
    SNO NUMBER(5),
    STR_VAL LONG,
    CREATED_DT DATE DEFAULT sysdate,
    COL2 CLOB,
    COL3 SYS.XMLTYPE
    SELECT dbms_lob.getlength(col2) from temp
    ->24754
    SQL> select col2 from temp;
    COL2
    &lt;DataSet1&gt;
    &lt;TAGSDATATABLE&gt;
    &lt;TAG_NAME&gt;KST20001&lt;/TAG_NA
    If i use the above stmt it shows only pice of data
    how can i get the actual data from this column.
    could anyone help to get the data.
    Regards
    Prakash
    Edited by: user12957183 on Aug 25, 2010 12:25 AM

    Insert data in to XMLTYPE table from clob variable:
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2  my_clob CLOB := '<DataSet1><TAGSDATATABLE><TAG_NAME>KST20001</TAG_NAME>
      3  </TAGSDATATABLE><TAGSDATATABLE><TAG_NAME>KST20002</TAG_NAME></TAGSDATATABLE>
      4  <TAGSDATATABLE><TAG_NAME>KST20003</TAG_NAME></TAGSDATATABLE>
      5  <TAGSDATATABLE>
      6  <TAG_NAME>KST20004</TAG_NAME>
      7  </TAGSDATATABLE>
      8  <TAGSDATATABLE>
      9  <TAG_NAME>KST20005</TAG_NAME>
    10  </TAGSDATATABLE>
    11  <TAGSDATATABLE>
    12  <TAG_NAME>KST20006</TAG_NAME>
    13  </TAGSDATATABLE>
    14  <TAGSDATATABLE>
    15  <TAG_NAME>KST20007</TAG_NAME>
    16  </TAGSDATATABLE>
    17  <TAGSDATATABLE>
    18  <TAG_NAME>KST20008</TAG_NAME>
    19  </TAGSDATATABLE>
    20  <TAGSDATATABLE>
    21  <TAG_NAME>KST20009</TAG_NAME>
    22  </TAGSDATATABLE>
    23  <TAGSDATATABLE>
    24  <TAG_NAME>KST20010</TAG_NAME>
    25  </TAGSDATATABLE>
    26  <TAGSDATATABLE>
    27  <TAG_NAME>KST20009</TAG_NAME>
    28  </TAGSDATATABLE>
    29  </DataSet1>';
    31  BEGIN
    33  INSERT INTO my_tab1 VALUES(XMLTYPE(my_clob));
    34* end;
    SQL> /
    PL/SQL procedure successfully completed.
    SQL> desc my_tab1;
    Name                                                                                                                  
    TABLE of XMLTYPE
    SQL>
    -- For larger data:
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2  my_clob CLOB := '<DataSet1>
      3  <TAGSDATATABLE>
      4  <TAG_NAME>KST20001</TAG_NAME>
      5  </TAGSDATATABLE>
      6  <TAGSDATATABLE>
      7  <TAG_NAME>KST20002</TAG_NAME>
      8  </TAGSDATATABLE>
      9  <TAGSDATATABLE>
    10  <TAG_NAME>KST20003</TAG_NAME>
    11  </TAGSDATATABLE>
    12  <TAGSDATATABLE>
    13  <TAG_NAME>KST20004</TAG_NAME>
    14  </TAGSDATATABLE>
    15  <TAGSDATATABLE>
    16  <TAG_NAME>KST20005</TAG_NAME>
    17  </TAGSDATATABLE>
    18  <TAGSDATATABLE>
    19  <TAG_NAME>KST20006</TAG_NAME>
    20  </TAGSDATATABLE>
    21  <TAGSDATATABLE>
    22  <TAG_NAME>KST20007</TAG_NAME>
    23  </TAGSDATATABLE>
    24  <TAGSDATATABLE>
    25  <TAG_NAME>KST20008</TAG_NAME>
    26  </TAGSDATATABLE>
    27  <TAGSDATATABLE>
    28  <TAG_NAME>KST20009</TAG_NAME>
    29  </TAGSDATATABLE>
    30  <TAGSDATATABLE>
    31  <TAG_NAME>KST20010</TAG_NAME>
    32  </TAGSDATATABLE>
    33  <TAGSDATATABLE>
    34  <TAG_NAME>KST20009</TAG_NAME>
    35  </TAGSDATATABLE>
    36  <TAGSDATATABLE>
    37  <TAG_NAME>KST20009</TAG_NAME>
    38  </TAGSDATATABLE>
    39  <TAGSDATATABLE>
    40  <TAG_NAME>KST20009</TAG_NAME>
    41  </TAGSDATATABLE>
    42  <TAGSDATATABLE>
    43  <TAG_NAME>KST20009</TAG_NAME>
    44  </TAGSDATATABLE>
    45  <TAGSDATATABLE>
    46  <TAG_NAME>KST20010</TAG_NAME>
    47  </TAGSDATATABLE>
    48  <TAGSDATATABLE>
    49  <TAG_NAME>KST20009</TAG_NAME>
    50  </TAGSDATATABLE>
    51  <TAGSDATATABLE>
    52  <TAG_NAME>KST20009</TAG_NAME>
    53  </TAGSDATATABLE>
    54  <TAGSDATATABLE>
    55  <TAG_NAME>KST20009</TAG_NAME>
    56  </TAGSDATATABLE>
    57  <TAGSDATATABLE>
    58  <TAG_NAME>KST20009</TAG_NAME>
    59  </TAGSDATATABLE>
    60  <TAGSDATATABLE>
    61  <TAG_NAME>KST20010</TAG_NAME>
    62  </TAGSDATATABLE>
    63  <TAGSDATATABLE>
    64  <TAG_NAME>KST20009</TAG_NAME>
    65  </TAGSDATATABLE>
    66  <TAGSDATATABLE>
    67  <TAG_NAME>KST20009</TAG_NAME>
    68  </TAGSDATATABLE>
    69  <TAGSDATATABLE>
    70  <TAG_NAME>KST20009</TAG_NAME>
    71  </TAGSDATATABLE>
    72  <TAGSDATATABLE>
    73  <TAG_NAME>KST20009</TAG_NAME>
    74  </TAGSDATATABLE>
    75  <TAGSDATATABLE>
    76  <TAG_NAME>KST20010</TAG_NAME>
    77  </TAGSDATATABLE>
    78  <TAGSDATATABLE>
    79  <TAG_NAME>KST20009</TAG_NAME>
    80  </TAGSDATATABLE>
    81  <TAGSDATATABLE>
    82  <TAG_NAME>KST20009</TAG_NAME>
    83  </TAGSDATATABLE>
    84  <TAGSDATATABLE>
    85  <TAG_NAME>KST20009</TAG_NAME>
    86  </TAGSDATATABLE>
    87  <TAGSDATATABLE>
    88  <TAG_NAME>KST20009</TAG_NAME>
    89  </TAGSDATATABLE>
    90  <TAGSDATATABLE>
    91  <TAG_NAME>KST20010</TAG_NAME>
    92  </TAGSDATATABLE>
    93  <TAGSDATATABLE>
    94  <TAG_NAME>KST20009</TAG_NAME>
    95  </TAGSDATATABLE>
    96  <TAGSDATATABLE>
    97  <TAG_NAME>KST20009</TAG_NAME>
    98  </TAGSDATATABLE>
    99  <TAGSDATATABLE>
    100  <TAG_NAME>KST20009</TAG_NAME>
    101  </TAGSDATATABLE>
    102  <TAGSDATATABLE>
    103  <TAG_NAME>KST20009</TAG_NAME>
    104  </TAGSDATATABLE>
    105  <TAGSDATATABLE>
    106  <TAG_NAME>KST20010</TAG_NAME>
    107  </TAGSDATATABLE>
    108  <TAGSDATATABLE>
    109  <TAG_NAME>KST20009</TAG_NAME>
    110  </TAGSDATATABLE>
    111  <TAGSDATATABLE>
    112  <TAG_NAME>KST20009</TAG_NAME>
    113  </TAGSDATATABLE>
    114  <TAGSDATATABLE>
    115  <TAG_NAME>KST20009</TAG_NAME>
    116  </TAGSDATATABLE>
    117  <TAGSDATATABLE>
    118  <TAG_NAME>KST20009</TAG_NAME>
    119  </TAGSDATATABLE>
    120  <TAGSDATATABLE>
    121  <TAG_NAME>KST20010</TAG_NAME>
    122  </TAGSDATATABLE>
    123  <TAGSDATATABLE>
    124  <TAG_NAME>KST20009</TAG_NAME>
    125  </TAGSDATATABLE>
    126  <TAGSDATATABLE>
    127  <TAG_NAME>KST20009</TAG_NAME>
    128  </TAGSDATATABLE>
    129  <TAGSDATATABLE>
    130  <TAG_NAME>KST20009</TAG_NAME>
    131  </TAGSDATATABLE>
    132  <TAGSDATATABLE>
    133  <TAG_NAME>KST20009</TAG_NAME>
    134  </TAGSDATATABLE>
    135  <TAGSDATATABLE>
    136  <TAG_NAME>KST20010</TAG_NAME>
    137  </TAGSDATATABLE>
    138  <TAGSDATATABLE>
    139  <TAG_NAME>KST20009</TAG_NAME>
    140  </TAGSDATATABLE>
    141  <TAGSDATATABLE>
    142  <TAG_NAME>KST20009</TAG_NAME>
    143  </TAGSDATATABLE>
    144  <TAGSDATATABLE>
    145  <TAG_NAME>KST20009</TAG_NAME>
    146  </TAGSDATATABLE>
    147  </DataSet1>';
    148  l_xmltype xmltype;
    149  BEGIN
    150  --l_xmltype := my_clob;
    151  INSERT INTO my_tab1 VALUES(XMLTYPE(my_clob));
    152* end;
    SQL> /
    PL/SQL procedure successfully completed.
    SQL> Edited by: AP on Aug 25, 2010 4:46 AM

  • Update XML data stored in CLOB Column

    Hi All,
    i am new to Oracle and new to SQL
    i am trying to update XML data stored in CLOB cloumn,data is stored with the follwoing format
    <attrs><attr name="name"><string>Schade</string></attr></attrs>
    i am using the following query for updating the value
    UPDATE PRODUCT p SET ATTRIBUTES_nl_nl=UPDATEXML(XMLTYPE.createXML(ATTRIBUTES_nl_nl),'/attrs/attr[@name="name"]/string/text()','Schade').getClobVal() WHERE p.sku='000000000000040576_200911-5010057'
    this query is working fine but it changing the data to the following format
    <attrs><attr name="name">Schade</attr></attrs>
    some how it is ommiting the <string> tag from it, i am unable to figure it out whats the reason.
    any help in this regard will b e much appriciated
    Thanks in Advance
    -Umesh

    Hi,
    You should have created your own thread for this, and included database version.
    This works for me on 11.2.0.2 and 10.2.0.5 :
    SQL> create table t_org ( xml_clob clob );
    Table created
    SQL>
    SQL> insert into t_org
      2  values(
      3  '<Message>
      4  <Entity>
      5  <ASSIGNMENT>
      6  <OAVendorLocation> </OAVendorLocation>
      7  <Vendorid>1</Vendorid>
      8  </ASSIGNMENT>
      9  </Entity>
    10  </Message>'
    11  );
    1 row inserted
    SQL> commit;
    Commit complete
    SQL> select '*' ||
      2         extractvalue(xmltype(xml_clob),'/Message/Entity/ASSIGNMENT/OAVendorLocation')
      3         || '*' as result
      4  from t_org;
    RESULT
    SQL> update t_org set xml_clob =
      2  updatexml(xmltype(xml_clob),
      3  '/Message/Entity/ASSIGNMENT/OAVendorLocation/text()','LONDON').getClobVal()
      4  ;
    1 row updated
    SQL> select '*' ||
      2         extractvalue(xmltype(xml_clob),'/Message/Entity/ASSIGNMENT/OAVendorLocation')
      3         || '*' as result
      4  from t_org;
    RESULT
    *LONDON*
    Does the OAVendorLocation really have a whitespace value?
    If not then it's expected behaviour, you're trying to update a text() node that doesn't exist. In this case, the solution is to use appendChildXML to create the text() node, or update the whole element.
    Is it your real document? Do you actually have some namespaces?

  • How to query XML data stored in a CLOB column

    I don't know XMLDB, so I have a dumb question about querying XML data which is saved as CLOB in a table.
    I have a table (OLAP_AW_PRC), with a CLOB column - AW_XML_TMPL_VAL
    This column contains this xml data - [click here|http://www.nasar.net/aw.xml]
    Now I want to query the data using the xml tags - like returning the name of AW. This is where I am having trouble, how to query the data from AW_XML_TMPL_VAL clob column.
    The following query generates error:
    ORA-31011: XML parsing failed.
    ORA-19202: Error occurred in XML processing
    LPX-00229: input source is empty
    SELECT
    extractValue(value(x), '/AW/LongName') as "AWNAME"
    from
    OLAP_AW_PRC,
    table(xmlsequence(extract (xmltype(AW_XML_TMPL_VAL), '/AWXML/AWXML.content/Create/ActiveObject/AW'))) x
    where
    extractValue(value(x) , '/AW/Name') = 'OMCR4'
    - Nasar

    Mark,
    Thanks. This is exactly what I was looking for.
    After doing @Name in both places (SELECT and WHERE clause) it worked.
    Now I have one more question.
    There are multiple DIMENSION tags in my xml, and I want to see the NAME attribute values for all of those DIMENSIONs. The following query returns
    ORA-19025: EXTRACTVALUE returns value of only one node.
    Cause: Given XPath points to more than one node.
    Action: Rewrite the query so that exactly one node is returned.
    SELECT
    extractValue(value(x), '/AW/@Name') as "AW",
    extractValue(value(x), '/AW/Dimension/@Name') as "DIMENSIONS"
    from
    OLAP_AW_PRC,
    table(xmlsequence(extract (xmltype(AW_XML_TMPL_VAL), '/AWXML/AWXML.content/Create/ActiveObject/AW'))) x
    where
    extractValue(value(x) , '/AW/@Name') = 'OMCR4'

  • Trying to Insert an XML Element into XML data stored in CLOB column

    Hi all,
    My ORACLE DB version is:
    ('Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production');
    ('PL/SQL Release 11.2.0.2.0 - Production');
    ('CORE 11.2.0.2.0 Production');
    ('TNS for Linux: Version 11.2.0.2.0 - Production');
    ('NLSRTL Version 11.2.0.2.0 - Production');
    I have this XML data stored in a CLOB column:
    <Activity>
         <Changes>     
         </Changes>
         <Inserts>     
         </Inserts>
         <Definition>     
         </Definition>
         <Assignment TYPE="Apply">     
         </Assignment>
         <Spawned>
              <Activity>576D8CD9-57A1-8608-1563-8F6DC74BDF3C</Activity>
              <Activity>11226E79-5D24-02EB-A950-D34A9CCFB3FF</Activity>
              <Activity>DAA68DC0-CA9A-BB15-DE31-9596E19513EE</Activity>
              <Activity>93F667D6-966A-7EAD-9B70-630D9BEFDDD2</Activity>
              <Activity>FA63D9D3-86BB-3FF0-BE69-17EAA7581637</Activity>
         </Spawned>
         <SpawnedBy>AFC49BD4-5AA7-38C0-AE27-F59D16EE1B1C</SpawnedBy>
    </Activity>
    I am in need of some assistance in creating an update that will insert another <Activity>SomeGUID</Activity> into the <Spawned> parent.
    Any help is greatly appreciated.
    Thanks.
    Edited by: 943783 on Dec 14, 2012 12:58 PM

    See XML updating functions : http://docs.oracle.com/cd/E11882_01/appdev.112/e23094/xdb04cre.htm#i1032611
    For example :
    UPDATE my_table t
    SET t.my_clob =
          XMLSerialize(document
            insertChildXML(
              XMLParse(document t.my_clob)
            , '/Activity/Spawned'
            , 'Activity'
            , XMLElement("Activity", 'Some GUID')
    WHERE ...
    ;Although it works, there's overhead introduced by parsing the CLOB, then serializing again.
    Is there any chance you can change the CLOB to SECUREFILE binary XMLType storage instead?
    You would then be able to benefit from optimized piecewise update of the XML and improved storage.

  • Parsing XML data stored as CLOB in DB and save attribute values in table

    Hello,
    I have a CLOB column in table that is holding XML data as follows,
    <banners>
    <banner-image id="0">
    <type>BANNER</type>
    <local-path>http.gif</local-path>
    <click-through-url>www</click-through-url>
    <make>Acura</make>
    </banner-image>
    <banner-image id="1">
    <type>BANNER</type>
    <local-path>http.gif</local-path>
    <click-through-url>gfrty</click-through-url>
    <make>BMW</make>
    </banner-image>
    </banners>
    Now I need to parse thru the above XML data and pull the attribute values to store in another table as follows,
    BANNER_IMAGE_ID | TYPE | LOCAL_PATH | CLICK_URL | MAKE
    0 | BANNER | http.gif | www | Acura
    1 | BANNER | http.gif | gfrty | BMW
    And XML data doesn't always end up with 2 rows in this table....some times it may be 3 or 4 as well. It is just that in this example it ended up with 2 rows.
    So, I would appreciate if someone can help me find a generic way of doing this,
    Thank you in advance,
    Madhu.

    This is not a reply.. sorry.
    I took have a similar problem only..
    can you pls help me
    XML structure.
    <PODetails>
    <POHeader>
    <CurrencyID>INR</CurrencyID>
    <ExchangeRate>1</ExchangeRate>
    <RefNo>0080000110</RefNo>
    <VendorID>1200</VendorID>
    <TransDate>2006-12-20</TransDate>
    <DocRelationshipId>PURCHASE</DocRelationshipId>
    <LocationID>0000102327</LocationID>
    </POHeader>
    <POItemDetails>
    <ItemID>ARSH1332</ItemID>
    <Size>L HS</Size>
    <Quality>Q1</Quality>
    <CustPO>rush order</CustPO>
    <UOM>PC</UOM>
    <Quantity>3.000</Quantity>
    <PriceValue>2509.5</PriceValue>
    <TaxAmount>0.00</TaxAmount>
    </POItemDetails>
    <POItemDetails>
    <ItemID>ARSH1332</ItemID>
    <Size>M HS</Size>
    <Quality>Q1</Quality>
    <CustPO>rush order</CustPO>
    <UOM>PC</UOM>
    <Quantity>2.000</Quantity>
    <PriceValue>1673</PriceValue>
    <TaxAmount>0.00</TaxAmount>
    </POItemDetails>
    <POItemDetails>
    <ItemID>ARSH1556</ItemID>
    <Size>39FS</Size>
    <Quality>Q1</Quality>
    <CustPO>rush order</CustPO>
    <UOM>PC</UOM>
    <Quantity>1.000</Quantity>
    <PriceValue>836.5</PriceValue>
    <TaxAmount>0.00</TaxAmount>
    </POItemDetails>
    </PODetails>
    The DB is ORACLE 9i
    This is stored in a XML table of type XMLTYPE.
    THIS I USED THE .extract function to get the values of the nodes.
    POHeader details are working fine. But when i get the POItemDetails i am getting 'ARSH1332ARSH1332ARSH1556' when i issue the command
    select a.extract('/PODetails/POItemDetails/ItemID/text()').getStringVal() ItemID
    FROM xmltable a
    WHERE a.existsnode('//POItemDetails/ItemID')=1
    Pls Help..
    Regds,
    Santhoshkumar.G.

  • How to read xml data from jsf,

    Hi
    I would like to know how to read data in an xml so as we can display that data onto the jsf page to the user, say as a data table, or in an output txt box etc...

    This is nothing JSF-special. Just convert XML to objects (DTO's) and then use them in JSF.
    There are several ways to crawl the XML tree. JXPath and DOM4J are popular.

  • How to use XML data stored in table column in XML Data Definition

    Hi,
    We are using BIP 5.6.3 (Oracle EBS R12).
    We have a table which stores XML data in a column. Is there a way we can use this XML data through a SQL query in XML Data Definition of BI Publisher report instead or writing whole SQL query to fetch same data from Oracle EBS?
    Can some please provide a sample SQL query that we should use in Data Definition?
    Thanks!

    Mark,
    Thanks. This is exactly what I was looking for.
    After doing @Name in both places (SELECT and WHERE clause) it worked.
    Now I have one more question.
    There are multiple DIMENSION tags in my xml, and I want to see the NAME attribute values for all of those DIMENSIONs. The following query returns
    ORA-19025: EXTRACTVALUE returns value of only one node.
    Cause: Given XPath points to more than one node.
    Action: Rewrite the query so that exactly one node is returned.
    SELECT
    extractValue(value(x), '/AW/@Name') as "AW",
    extractValue(value(x), '/AW/Dimension/@Name') as "DIMENSIONS"
    from
    OLAP_AW_PRC,
    table(xmlsequence(extract (xmltype(AW_XML_TMPL_VAL), '/AWXML/AWXML.content/Create/ActiveObject/AW'))) x
    where
    extractValue(value(x) , '/AW/@Name') = 'OMCR4'

  • How to read xml data?

    I need urgent help with this code to read xml nodes from an xml file.
    This is the HttpService
    <mx:HTTPService id="appraisalData"
                        url="assets/appraisal.xml"
                        result="HandleDataResult(event)"
                         />
    ::SCRIPT::
    [Bindable]
                private var _appData:XMLList=new XMLList();
                private function HandleDataResult(event:ResultEvent):void
                                _appData=event.result.appraisal.APPRAISAL;
    I want to extract nodes from this XMLList and fill my components
    Like:
    <components:HeaderSection width="100%"  headerData="{XML(_appData[0])}"/>
    Here's the XML file sample:
    <?xml version="1.0"?>
    <APPRAISAL>
    <ACTIONS/>
    <RATINGSTATUS>
    <MIDYEAR>
    <EDITABLE>false</EDITABLE>
    <VISIBLE>true</VISIBLE>
    </MIDYEAR><YEAREND>
    <EDITABLE>false</EDITABLE>
    <VISIBLE>true</VISIBLE>
    </YEAREND></RATINGSTATUS>
    <HEADER>
    <PLAN_VERSION>01</PLAN_VERSION>
    <APPRAISAL_ID>4B1DF5B7B24100A7E1008000AC11A294</APPRAISAL_ID>
    <EMPLOYEE>Tom Smith</EMPLOYEE>
    <LEADER>Bob string hello Jr</LEADER>
    <APPRAISAL_TYPE>2010 Individual Contributor</APPRAISAL_TYPE>
    <AP_START_DATE>01/01/2009</AP_START_DATE>
    <AP_END_DATE>12/31/2009</AP_END_DATE>
    <AP_STATUS>2</AP_STATUS>
    <AP_STATUS_NAME>In Planning</AP_STATUS_NAME>
    <AP_STATUS_SUB>4</AP_STATUS_SUB>
    <AP_STATUS_SUB_NAME>Pending Transfer</AP_STATUS_SUB_NAME>
    <ORGUNIT>Payroll Test Org.2</ORGUNIT>
    <PERSONAL_AREA>CA-Catalina Island</PERSONAL_AREA>
    <PERSONAL_SUBAREA>Teamsters - 495</PERSONAL_SUBAREA>
    <EE_GROUP>Hourly</EE_GROUP>
    <EE_SUBGROUP>Full Time Non-Exempt</EE_SUBGROUP>
    </HEADER>

    Honeeeey, I'm hooome! So... here's the code:
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    import mx.rpc.events.FaultEvent;
    import mx.rpc.events.ResultEvent;
    import mx.collections.ArrayCollection;
    private var myRetrivedData:ArrayCollection;
    private function getXMLData():void
         httpService.send();
    private function httpFaultHandler(event:FaultEvent):void
         Alert.show("Cannot load XML file.","Error");
    private function httpResultHandler(event:ResultEvent):void
         myRetrivedData=event.result.elements.element;
    ]]>
    </mx:Script>
    <mx:HTTPService id="httpService" url="someXMLFile.xml"
         fault="httpFaultHandler(event)" result="httpResultHandler(event)"/>
    <mx:DataGrid id="myDataGrid" dataProvider="{myRetrivedData}"/>

  • How to read XML data from URL

    Hi All,
    I have one requirement. I have one URL which gives me data in XML format. I need to read this file and store this data into my SAP tables.
    Can anybody suggest how read this XML file using URL?
    Thanks in advance,
    P.Shridhar.

    Use a Server java proxy generated from your inbound message interface which would make a URLConnection to the specified URL after it gets triggered by BPM. A code snippet to achieve the same could be
    URL url  = null;
    URLConnection conn = null;
    BufferedReader in = null;
    url = new URL("http://someurl.someserver.com");
    conn = url.openConnection();
    in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
    String line = null;
    StringBuffer xml = new StringBuffer();
    while ((line = in.readLine()) != null){
            xml.append(line);
    -- amol

  • How to read xml data in ajava file?

    Hi,
    I am very new to web servies. I am having a xml file, which has some data. I want to get tht data in my java class.How can I do tht? i would appreciate if anyone help me out.

    http://java.sun.com/webservices/docs/1.6/tutorial/doc/index.html

  • How to read XML data Generated out of Personnel Change Request?

    Hi,
    Is it possible to read the following attributes of an XML file which is generated from a PCR form created on Enterprise Portal:
    1. Time Stamps
    2. Data
    3. Location
    Any pointer will be of a great help.
    Thanks
    Deepak

    hi,
    pls chk this link.
    /people/tobias.trapp/blog/2006/08/22/xml-processing-in-abap-part-8--using-xslt-for-validation
    Regards
    Raja

  • How to read xml file and place it into an internal table...

    hello all,
    can any one help me in - how to read xml data file (placed in application server) and placing the same into an internal table (remove the xml tags or say fetching the xml data without xml tags).

    Hi Murashali,
    use this.
    TYPES: BEGIN OF day,
    name TYPE string,
    work(1) TYPE c,
    END OF day.
    DATA: BEGIN OF week,
    day1 TYPE day,
    day2 TYPE day,
    day3 TYPE day,
    day4 TYPE day,
    day5 TYPE day,
    day6 TYPE day,
    day7 TYPE day,
    END OF week.
    DATA xml_string TYPE string.
    DATA result LIKE week.
    week-day1-name = 'Monday'. week-day1-work = 'X'.
    week-day2-name = 'Tuesday'. week-day2-work = 'X'.
    week-day3-name = 'Wednesday'. week-day3-work = 'X'.
    week-day4-name = 'Thursday'. week-day4-work = 'X'.
    week-day5-name = 'Friday'. week-day5-work = 'X'.
    week-day6-name = 'Saturday'. week-day6-work = ' '.
    week-day7-name = 'Sunday'. week-day7-work = ' '.
    CALL TRANSFORMATION ...
    SOURCE root = week
    RESULT XML xml_string.
    CALL TRANSFORMATION ...
    SOURCE XML xml_string
    RESULT root = result.
    Regards,
    Vijay

  • How to formulate SQL that need to use some XML data in a clob?

    Hi,
    We just created a new 8i table that has some regular fields as well as a clob field that contains XML data. How could I bring back the value of a spcific element in the XML field and compare it against a regular field? For example, I want to make sure the value in field A is not the same as the value of a specific element in field b. Your help is very much appreciated.
    select * from X
    where X.a <> X.b.elementZ

    Depending on how complex your XML data is, you can write a simple function that does a string search of the CLOB and returns the value of the tag you are looking at. Then you can compare the value of the tag and the value of the the column.
    select * from X
    where x.a <> getTagValue(X.b,'elementZ')
    Check out the DBMS_LOB package.

  • How to insert more than 32k xml data into oracle clob column

    how to insert more than 32k xml data into oracle clob column.
    xml data is coming from java front end
    if we cannot use clob than what are the different options available

    Are you facing any issue with my code?
    String lateral size error will come when you try to insert the full xml in string format.
    public static boolean writeCLOBData(String tableName, String id, String columnName, String strContents) throws DataAccessException{
      boolean isUpdated = true;
      Connection connection = null;
      try {
      connection = ConnectionManager.getConnection ();
      //connection.setAutoCommit ( false );
      PreparedStatement PREPARE_STATEMENT = null;
      String sqlQuery = "UPDATE " + tableName + " SET " + columnName + "  = ?  WHERE ID =" + id;
      PREPARE_STATEMENT = connection.prepareStatement ( sqlQuery );
      // converting string to reader stream
      Reader reader = new StringReader ( strContents );
      PREPARE_STATEMENT.setClob ( 1, reader );
      // return false after updating the clob data to DB
      isUpdated = PREPARE_STATEMENT.execute ();
      PREPARE_STATEMENT.close ();
      } catch ( SQLException e ) {
      e.printStackTrace ();
      finally{
      return isUpdated;
    Try this JAVA code.

Maybe you are looking for