Browsing in XMLTYPE field.

Hi,
I've inserted XML into an XMLTYPE field in an ORACLE table.
Here's the data:
<NewDataSet>
<PRINT_ERROR_LIST>
<CENTRAL_PRINTING_BATCH_ID>123</CENTRAL_PRINTING_BATCH_ID>
<ENVELOPE_ID>2</ENVELOPE_ID>
<FAILURE_REASON_CODE>hello world</FAILURE_REASON_CODE>
</PRINT_ERROR_LIST>
<PRINT_ERROR_LIST>
<CENTRAL_PRINTING_BATCH_ID>124</CENTRAL_PRINTING_BATCH_ID>
<ENVELOPE_ID>3</ENVELOPE_ID>
<FAILURE_REASON_CODE>hello world</FAILURE_REASON_CODE>
</PRINT_ERROR_LIST>
<PRINT_ERROR_LIST>
<CENTRAL_PRINTING_BATCH_ID>125</CENTRAL_PRINTING_BATCH_ID>
<ENVELOPE_ID>4</ENVELOPE_ID>
<FAILURE_REASON_CODE>hello world</FAILURE_REASON_CODE>
</PRINT_ERROR_LIST>
</NewDataSet>
Now, I want to browse the XML and update a record for each CENTRAL_PRINTING_BATCH_ID, in this case i got 3.
I'm new to XML, any EASY way in PL/SQL to do this?
Please Help.

You can use UPDATEXML. For syntax and example, check here
http://www.psoug.org/reference/xml_functions.html

Similar Messages

  • How can i set a long String to a xmltype field in oracle9i use PHP?

    i can set xml String to xmltype field with:
    $sql_insert_sql = "insert into g_province (p_id,p_regionid,p_provincenameobj,solt)
    values (g_province_q.nextval,'".$_GET['region_id']."',sys.XMLTYPE.createXML('".$xml_con."'),0)";
    but if $xml_con too long,i can not set this content into xmltype fields.
    then , i use :
    <?
    //(tabel_name:articles)DDL; //just for test;
    //create table articles (id number(11),content sys.xmltype);
    //----------This is insert test----------------------------------
    $conn = @OCILogon("in_user","user_in","bigfish");
    $stmt = @OCIParse($conn,"insert into articles (id,content) values(1,xmltype(EMPTY_CLOB())) RETURNING content INTO:CONTENT");
    $clob = @OCINewDescriptor($conn,OCI_D_LOB);
    OCIBindByName($stmt,':CONTENT',&$clob,"1",OCI_B_CLOB);
    OCIExecute($stmt,OCI_DEFAULT);
    if ($clob->save("<root><a>JUST TEST</a></root>")){
    OCICommit($conn);
    echo "Insert succes!";
    else{
    echo "Insert default!";
    //---------------Insert end-----------------------------------------
    //---------------Select start---------------------------------------
    $sql = "select content from articles order by id desc";
    $stmt = @OCIParse($conn,$sql);
    @OCIExecute($stmt,OCI_DEFAULT);
    @OCIFetchInto($stmt,&$rows,OCI_RETURN_LOBS);
    echo "<br>Content is:\"".$rows[0]."\"";
    //---------------Select end-----------------------------------------
    ?>
    run it ,display these errors:
    Warning: ociexecute(): OCIStmtExecute: ORA-22816: unsupported feature with RETURNING clause in /home/www/bigfish/sgtest/testclob.php on line 12
    Warning: save(): OCILobWrite: OCI_INVALID_HANDLE in /home/www/bigfish/sgtest/testclob.php on line 13
    Insert default!
    Content is:""
    Warning: Unknown(): ociclose_session: OCISessionEnd: ORA-00600: internal error code, arguments: [729], [28], [space leak], [], [], [], [], [] in Unknown on line 0
    how can i set long content to xmltype fields??

    geng sun,
    Ora-00600 is an internal Oracle error. You will need to open a tar with Oracle.

  • How can i set a long String to a xmltype field use PHP?

    i can set xml String to xmltype field with:
    $sql_insert_sql = "insert into g_province (p_id,p_regionid,p_provincenameobj,solt)
         values (g_province_q.nextval,'".$_GET['region_id']."',sys.XMLTYPE.createXML('".$xml_con."'),0)";
    but if $xml_con too long,i can not set this content into xmltype fields.
    then , i use :
    <?
    //(tabel_name:articles)DDL; //just for test;
    //create table articles (id number(11),content sys.xmltype);
    //----------This is insert test----------------------------------
    $conn = @OCILogon("in_user","user_in","bigfish");
    $stmt = @OCIParse($conn,"insert into articles (id,content) values(1,xmltype(EMPTY_CLOB())) RETURNING content INTO:CONTENT");
    $clob = @OCINewDescriptor($conn,OCI_D_LOB);
    OCIBindByName($stmt,':CONTENT',&$clob,"1",OCI_B_CLOB);
    OCIExecute($stmt,OCI_DEFAULT);
    if ($clob->save("<root><a>JUST TEST</a></root>")){
    OCICommit($conn);
    echo "Insert succes!";
    else{
    echo "Insert default!";
    //---------------Insert end-----------------------------------------
    //---------------Select start---------------------------------------
    $sql = "select content from articles order by id desc";
    $stmt = @OCIParse($conn,$sql);
    @OCIExecute($stmt,OCI_DEFAULT);
    @OCIFetchInto($stmt,&$rows,OCI_RETURN_LOBS);
    echo "<br>Content is:\"".$rows[0]."\"";
    //---------------Select end-----------------------------------------
    ?>
    run it ,display these errors:
    Warning: ociexecute(): OCIStmtExecute: ORA-22816: unsupported feature with RETURNING clause in /home/www/bigfish/sgtest/testclob.php on line 12
    Warning: save(): OCILobWrite: OCI_INVALID_HANDLE in /home/www/bigfish/sgtest/testclob.php on line 13
    Insert default!
    Content is:""
    Warning: Unknown(): ociclose_session: OCISessionEnd: ORA-00600: internal error code, arguments: [729], [28], [space leak], [], [], [], [], [] in Unknown on line 0
    how can i set long content to xmltype fields??

    geng sun,
    Ora-00600 is an internal Oracle error. You will need to open a tar with Oracle.

  • Error while inserting the value in xmltype field of oracle using ALDSP?

    I am getting the following error, while trying to insert the large xml in the xmltype field of oracle using aldsp service:
    inconsistent datatypes: expected - got CLOB in bea
    But this error does not occur when the input xml is of smaller size.

    Please post the complete error message and stack trace.

  • R4 EA: Error loading a table with an XMLTYPE field

    When I try to view the data in a table with an XMLTYPE field I get the following error in R4 EA Version 4.0.0.12 Build MAIN-12-27.  This works in 2.2 and 3.0.
    oracle.sqldeveloper.migration.application
         Error: Resource not found: ${SCRATCH_COMMAND_ICON}.
    Double clicking on the error opens the EXTENSION.XML file and shows this line:
    <trigger-hooks xmlns="http://xmlns.oracle.com/ide/extension">
      <!-- Add registry here if required -->
      <triggers xmlns:c="http://xmlns.oracle.com/ide/customization">
        <actions xmlns="http://xmlns.oracle.com/jdeveloper/1013/extension">
          <action id="MigrationProject.ApplicationScan">
            <properties>
              <property name="Name">${APPSCAN_TITLE}</property>
              <property name="MnemonicKey">${APPSCAN_TITLE2}</property>
              <property name="SmallIcon">res:${SCRATCH_COMMAND_ICON}</property>
            </properties>
          </action>
        </actions>
    The table has the following definition:
    ID    NUMBER(38,0)    No
    WS_DATA    XMLTYPE    Yes
    WS_SNAPSHOT_ID    NUMBER(38,0)    No
    Any help would be greatly appreaciated.  We have to upgrade to 4.0 because our security team will no longer allow Java 6 on any server or workstation.
    Thanks,
    Steve

    Hi Steve
    Still no response?
    I am having same issue when querying a table with XMLTYPE.
    How is your XMLTYPE stored in the DB, as a CLOB or as a BINARY XML?
    Regards,
    Shaun

  • How to get node value of XML file from XMLTYPE field of databases

    Hi,
    I want to select node value of XML from XMLTYPE field of oracle db into java code.
    Feel free to answer me if you have any idea about it.
    Thanks

    For XMLType refer
    http://www.oracle.com/oramag/oracle/01-nov/o61xml.html
    http://www.lc.leidenuniv.nl/awcourse/oracle/appdev.920/a96620/xdb04cre.htm

  • How to update xmltype field in the table

    hi
    I have table in DB which contains xmltype field. When I am dragging this table by wizard on a panel and run my project I cannot edit any field in this table and save its data it shows an error. But when I am not using xmltype field in a table then my program runs well.
    How can I fix this proble?

    repost

  • How associating an XMLSchema to an XMLType Field with the database model ?

    How can I precise the XMLSchema to an XMLType Field with the database model ?
    I know how to do it in a SQL Syntax :
    CREATE TABLE xwarehouses (
    warehouse_id NUMBER,
    warehouse_spec XMLTYPE)
    XMLTYPE warehouse_spec STORE AS OBJECT RELATIONAL
    XMLSCHEMA "http://www.oracle.com/xwarehouses.xsd"
    ELEMENT "Warehouse";
    , but we have decided to generate the script with the Jdeveloper database modeler tools, and we don't how to precise this with using this tools ?
    Anyone could help me ?

    I'm not sure that it answers your question but under the tools menu there is an option called register schema with XDB.

  • Partition by XMLTYPE field.

    Hi All,
    Is it possible to create a partition table with XMLTYPE field? It tried but it will failing with the following error.
    SQL> CREATE TABLE TESTSAMPLE (
    2 recid number(4),
    3 xmlrecord xmltype
    4 )
    5 partition by hash(xmlrecord) (
    6 partition p1 tablespace skirandata,
    7 partition p2 tablespace testjamal
    8 );
    partition by hash(xmlrecord) (
    ERROR at line 5:
    ORA-14513: partitioning column may not be of object datatype
    SQL>
    Kindly let me know whether we can create partition table with XMLTYPE field?
    Thanks
    karti

    If you are using 11g release 2.0 yes you can ...
    Lower versions do not support partition with XML Type columns .......
    Go through this link http://www.pi-halbe.de/manuals/E11882_01/appdev.112/e10492/xdb06stt.htm#BHAFCACA
    Cheers :)
    Renjith Madhavan

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

  • XMLType field Size Limitation

    Hi,
    I am using Oracle DB 9.2.0 version and Toplink 9.0.3 version.
    Tables in the database have some fields defined as XMLType and i am using toplink's mapping to insert values in those fields. (Note: This was not directly possible but there was a patch provided by oracle which made this work). The mapped object's xmltype variable is defined as String.
    Now I wanted to know if there is any size limitations on the XML content to be inserted in the database XMLType field. If so please do let me know exact size.
    Thanks,

    Good afternoon,
    The folks on the Oracle XDB forum might be able to better answer your question.
    Oracle XDB Forum:
    XML DB
    -Blaise

  • How to write xml from odi model directly to XMLType field in database?

    I've created xml model and populated it with data.
    How can I save it directly to the XMLType field in Oracle 10g database?

    You only have the option of all or nothing, you don't have the option of writing one file for each of the root elements.
    SYNCHRONIZE to FILE
    See the Driver doc at: http://download.oracle.com/docs/cd/E14571_01/integrate.1111/e12644/appendix_xml_driver.htm#CHDICHDB
    and specifically: http://download.oracle.com/docs/cd/E14571_01/integrate.1111/e12644/appendix_xml_driver.htm#CHDGDDDF

  • Browsing an xmltype queue

    Hi all,
    I'm currently trying to browse an xmltype queue using JMS.
    When creating the queuebrowser a CustomDatumFactory is expected.
    What should be put there ?
    The only thing i found to make it compile is the following:
    browser = ((AQjmsSession)q_sess).createBrowser(queue,new XMLTypeFactory());
    However, when browsing the queue i only get one message.
    Is this code ok or should another factory be supplied ?
    tx for any help,
    Roger.

    My first recommendation is that both of you open SRs at metalink and lets see if we can get Oracle to fix this rather than just starting a workaround.
    I haven't tried this but I wonder what would happen if you did the following:
    ALTER TABLE <table_name> ENABLE ROW MOVEMENT;
    ALTER TABLE <table_name> SHRINK SPACE CASCADE;
    ALTER TABLE <table_name> DISABLE ROW MOVEMENT';Please let us know.

  • How to extract data from Oracle Table to an Oracle XMLtype field

    All,
    I'm very new with ODI and I'm looking for a way to implement the following scenario:
    I have the Oracle table A, already mapped to Data Model A. This table has the following fields:
    field X (PK)
    field Y
    field Z
    field W
    I have a table B, already mapped to Data Model B. This table has the following fields:
    field X (PK)
    field V (XMLType)
    I want to extract the data from Table A to a XML file with the following structure:
    <X> yada yada yada </X>
    <Y> yada yada yada </Y>
    <Z> yada yada yada </Z>
    <W> yada yada yada </W>
    and then insert this file into the field V of Table B. How can I do that?
    TIA,
    Rodrigo

    You can use UDConnect to get from Oracle database in to BW
    <b>Data Transfer with UD Connect -</b>
    http://help.sap.com/saphelp_nw04/helpdata/en/78/ef1441a509064abee6ffd6f38278fd/content.htm
    <b>Prerequisites</b>
    You have installed the SAP WAS J2EE Engine with BI Java components.  You can find more information on this in the SAP BW installation guide on the SAP Service Marketplace at service.sap.com/instguides.
    Hope it Helps
    Chetan
    @CP..

  • Using the Field Browser to update fields in Word.

    BIP: 11.1.1.5.0
    Word: 2007
    I have a large RTF template I'm editing in Word, where in I'm duplicating a block with about 120 fields in it. I've copy and pasted the block and now need to update each field to point at a new rowset. For example:
    <xsl:value-of select="//ROWSET9_ROW[CATALOG='Product']/FIELD_NAME" />
    Becomes
    <xsl:value-of select="//ROWSET30_ROW[CATALOG='Product']/FIELD_NAME" />
    Given at takes about 10 seconds for the "BI Publisher Properties" dialogue to open each time I double-click a field, I hoped to use the Field Browser to speed up this process. I read the documentation and find that if I select a section of my template and then open the Field Browser, it will open containing a list of only those fields so selected, I can then edit a field and save the edit by clicking the "Update" button. However, when you click the "Update" button the list of fields in the Field Browser is refreshed to include every field in the report! Is there a way to prevent this behaviour? Is there a fast way to perform this kind of mass update that I'm missing?

    those 2 are the only ways to modify the code as far as i know.
    yes i have read what u have written and if use field update method soon u update one field it will show all the fields in in the field browser .
    that why if u want to update it without error u can double click on code in field browser and it will open the form field in the template automatically.
    else copy your code to a new word document and update your code their using update method in field browser and paste the code in your orginal once the update for the code is done.

Maybe you are looking for

  • Is there a way to permanently resize the fonts?

    A friend of mine just bought his first Mac and is using Safari.  He is able to enlarge the fonts when he opens Safari, but has to resize them everytime he starts Safari.  I don't use Safari, so I can't help him - any solution?  TIA.

  • The Aperture Library could not be created at "/Volumes/Data/Aperture Library.aplibrary". Check the path and try again.

    Hi, I cannot reopen library. During opening aperture I can see a list of libraries. After selection "Aperture library.aplibrary" (default I guess) msg box is open "Library info directory path contains a file where a folder was expected. The Aperture

  • Display an error and cancel the job in F110

    Hi all. I use a BTE's to check some data in F110 transaction. I want to display some error and abort the proposal creation JOB. I can to abort the Proposal creation JOB with RAISE_EXCEPTION command, but I cannot display the error. how I can to displa

  • Standard tcode FBL5N dump in pre production.

    I am getting a dump when I execute the standard tcode FBL5N (Customer line item) with one company code.  FBL5N tcode is not at all giving dump in production system, however it dumps in pre production. The dump exists in the function module : fdm_loca

  • How to create dynamic disks in 2012R2

    I am trying to create dynamic disk in Windows 8.1 Could not find any forum online to get some help. Unable to create striped volumes as well, Diskpart Convert dynamic command does not work Any pointer is much appreciated