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

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.

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

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

  • Update multiply nodes on XMLType field

    Hello to all.
    I have this table
    +"DOCUMENT"+
    +(+
    +"ID" NUMBER NOT NULL ENABLE,+
    +"ID_ARCHIVE" NUMBER NOT NULL ENABLE,+
    +"USERNAME" VARCHAR2(20 BYTE),+
    +"CREATION_DATE" DATE,+
    +"LAST_UPDATE" DATE,+
    +"LAST_USERNAME" VARCHAR2(20 BYTE),+
    +"VISIBLE" NUMBER,+
    +"STATE" VARCHAR2(20 BYTE),+
    +"XML" "SYS"."XMLTYPE" ,)+
    This is an example of XML value:
    <?xml version="1.0" encoding="UTF-8"?>
    <root>
    <fields>
    <field fieldId="text_141536485" iterable="true" type="text" specification="simple" name="tiolo" value="1" required="false" status="ok" searchable="true" isField="true" isIterate="false"/><field fieldId="comp_1235813718" iterable="true" type="composite" specification="composite" status="ok" searchable="true" isField="true" isIterate="false">
    <fields>
    <field fieldId="text_-1661573009" iterable="true" type="text" specification="simple" name="New" value="1" required="false" status="ok" searchable="true" isField="true" isIterate="false"/>
    <field fieldId="text_-1661573009" iterable="true" type="text" specification="simple" name="New" value="2" required="false" status="ok" searchable="true" isField="true" isIterate="true"/>
    </fields>
    </field>
    <field fieldId="comp_1235813718" iterable="false" isIterate="true" type="default" specification="default" status="ok" isField="true">
    <fields/>
    </field>
    </fields>
    </root>
    Id like to update the attribute name of all fields whit fieldId="text_-1661573009" to, ie, 'Counter'
    I try this query:
    SELECT d.XML.extract('//field')  from DOCUMENT d
    *where d.XML.existsNode('//field[@fieldId="text_-1661573009"]')=1;*
    it returns all fields with fieldId="text_-1661573009"
    The update:
    update document d set .OBJECT_VALUE = d.XML.updateXML(OBJECT_VALUE,'//field/@fieldId','Counter')
    *where d.XML.existsNode(OBJECT_VALUE,'//field[@fieldId="text_-1661573009"]')=1;*
    I receive this error:
    Errore SQL: ORA-00904: "OBJECT_VALUE": invalid identifier
    *00904. 00000 - "%s: invalid identifier"*
    Somebody could help me to find the error?
    Thank you very much!
    Cristian

    Hi,
    I try this query:
    SELECT d.XML.extract('//field')  from DOCUMENT d
    *where d.XML.existsNode('//field[@fieldId="text_-1661573009"]')=1;*
    it returns all fields with fieldId="text_-1661573009"Actually, it returns all fields of a document where exists at least one field with fieldId "text_-1661573009".
    That will make a difference with updateXML, because it won't update the nodes you're expecting.
    I receive this error:
    Errore SQL: ORA-00904: "OBJECT_VALUE": invalid identifier
    00904. 00000 - "%s: invalid identifier"OBJECT_VALUE is only used to reference the column of an Object Type table, such as an XMLType table.
    Here, you're dealing with a regular table, so use the proper column name, ie "XML".
    Is this what you want to do :
    UPDATE document d
    SET d.xml = updateXML( d.xml,
                           '//field[@fieldId="text_-1661573009"]/@name',
                           'Counter' )
    WHERE d.xml.existsNode('//field[@fieldId="text_-1661573009"]') = 1
    ;?

  • Rename the root element  in a XMLTYPE field

    Hello, I have to rename the root element of an XMLTYPE like :
    Change :
    <Address>
    <Name>Dupont</Name>
    <Street>Av de la gare</Street>
    </Address>
    To :
    <CustomerAddress>
    <Name>Dupont</Name>
    <Street>Av de la gare</Street>
    </CustomerAddress>
    One solution will be to use the EXTRACT (a.xml, '/*/*') AS "CustomerAddress"
    I am just afraid about performance !!!
    Anyone has an advice
    Best Regards

    Pl go through this doc/Title
    XML Schema Evolution
    This chapter describes how you can update your XML schema after you have registered it with Oracle XML DB. XML schema evolution is the process of updating your registered XML schema and let me know if this helps.

Maybe you are looking for