Query about XMLTYPE column structured storage in Oracle Xml db

Dear All,
DB Version: Oracle 11g (11.2.0.3.0)
I have an table having one column as XMLTYPE with Structured storage.
CREATE TABLE Orders
    Order_id NUMBER NOT NULL,
    Order_etc VARCHAR2(100),
    Order_desc XMLType NOT NULL
    XMLTYPE Order_desc STORE AS OBJECT RELATIONAL XMLSCHEMA  "http://localhost/public/xsd/order_desc_xsd.xsd" ELEMENT "OrderState";
I have then registered the XSD with XML Db schema which is required for Structured storage.
Before this table creation I had created a table (db_objects) of XMLTYPE and was able to use the below query to check for what all objects the XMLTYPE table got broken into when I registered its XSD.
    SELECT column_name,     
           data_type
    FROM   user_tab_cols
    WHERE  table_name = 'DB_OBJECTS';
And used below query to look for data stored in Object-Relational structure for my table (DB_OBJECTS) created with XMLTYPE definition.
  SELECT EXTRACTVALUE(xseq.column_value, '/THISROW/OWNER')       AS owner
    ,      EXTRACTVALUE(xseq.column_value, '/THISROW/OBJECT_NAME') AS object_name
    ,      EXTRACTVALUE(xseq.column_value, '/THISROW/OBJECT_TYPE') AS object_type
    ,      EXTRACTVALUE(xseq.column_value, '/THISROW/OBJECT_ID')   AS object_id
    ,      EXTRACTVALUE(xseq.column_value, '/THISROW/CREATED')     AS created
    FROM   db_objects do
     ,      TABLE(XMLSEQUENCE(EXTRACT(VALUE(do), '/ROWSET/THISROW'))) xseq 
    WHERE  ROWNUM <= 10;
Now could someone let me know, how to find how the column (Order_desc) of XMLTYPE was broken down into further objects just like I did for the Table with XMLTYPE (as shown above)?
Many Thanks.

First given that you are on 11.2, ExtractValue is deprecated and the documentation lists three options to use instead.  Here is one option (untested)
SELECT owner, object_name, object_type, object_id, created
  FROM db_objects do,
       XMLTable('/ROWSET/THISROW'
                PASSING do.object_value
                COLUMNS
                -- Set data types accordingly
                owner        VARCHAR2(20) PATH 'owner',
                object_name  VARCHAR2(20) PATH 'object_name',
                object_type  VARCHAR2(20) PATH 'object_type',
                object_id    VARCHAR2(20) PATH 'object_id',
                created      VARCHAR2(20) PATH 'created');
Second, why does column order matter?  You are storing in an object relational method.  As long as the XML is valid per the schema, the Oracle will be able to store the data and later retrieve it as well.  How that data is stored is mostly Oracle internals and should not be touched as it can be changed from version to version.  You can use schema annotation to control how Oracle maps and stores the XML, but nothing in there specifies column order that I am aware of.
It seems additional details are missing as to what you need the information for so that would help others answer your question.

Similar Messages

  • Permission issues accross schemas to load XMLTYPE column - structured storage

    Hi,
    We have a table in BIUSER schema this table is object-realtionally stored with XMLs. When we are trying to load receords from ETLUSER schema we are getting the error as
    Record 1: Rejected - Error on table "BIUSER"."PWAYWORKFILE_TABLE".
    ORA-00604: error occurred at recursive SQL level 1
    ORA-01031: insufficient privileges
    Heres the oracle installation details
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    "CORE 11.2.0.3.0 Production"
    All the records are moving to the bad file, whereas the same load happens normally in its own schema i.e. BIUSER
    Suspecting this as permission issues we have already given the permission to the table sysnonym as given below in the registration script.
    We googled and found few things about ACLs that we are not sure of , its that is the issue please let us know if this table can be created and loaded from different schema
    Heres the table creation and registration script
    set echo on
    spool regschema.log
    set define on
    set timing on
    set long 100000 pages 0 lines 256 trimspool on timing on
    drop table PWAYWORKFILE_TABLE;
    drop sequence PWAYWORKFILE_TABLE_SEQ;
    begin
    dbms_xmlschema.deleteschema('workfile.xsd',dbms_xmlschema.DELETE_CASCADE);
    end;
    begin
    dbms_xmlschema.deleteschema('TotalLoss.xsd',dbms_xmlschema.DELETE_CASCADE);
    end;
    begin
    dbms_xmlschema.deleteschema('Salvage.xsd',dbms_xmlschema.DELETE_CASCADE);
    end;
    begin
    dbms_xmlschema.deleteschema('rate.xsd',dbms_xmlschema.DELETE_CASCADE);
    end;
    begin
    dbms_xmlschema.deleteschema('notes.xsd',dbms_xmlschema.DELETE_CASCADE);
    end;
    begin
    dbms_xmlschema.deleteschema('Image.xsd',dbms_xmlschema.DELETE_CASCADE);
    end;
    begin
    dbms_xmlschema.deleteschema('Event.xsd',dbms_xmlschema.DELETE_CASCADE);
    end;
    begin
    dbms_xmlschema.deleteschema('estimate.xsd',dbms_xmlschema.DELETE_CASCADE);
    end;
    begin
    dbms_xmlschema.deleteschema('CoTotals.xsd',dbms_xmlschema.DELETE_CASCADE);
    end;
    begin
    dbms_xmlschema.deleteschema('corr.xsd',dbms_xmlschema.DELETE_CASCADE);
    end;
    begin
    dbms_xmlschema.deleteschema('Admin.xsd',dbms_xmlschema.DELETE_CASCADE);
    end;
    begin
    dbms_xmlschema.deleteschema('Vins.xsd',dbms_xmlschema.DELETE_CASCADE);
    end;
    begin
    dbms_xmlschema.deleteschema('commonType.xsd',dbms_xmlschema.DELETE_CASCADE);
    end;
    declare
      V_XML_SCHEMA_NAME       VARCHAR2(700) := 'commonType.xsd';
      V_XML_SCHEMA             XMLType       := xmlType(BfileName('XSD_DIR',V_XML_SCHEMA_NAME),nls_charset_id('AL32UTF8'));
      V_SCHEMA_LOCATION_HINT   VARCHAR2(700) := 'commonType.xsd';
    BEGIN
      DBMS_XMLSCHEMA_ANNOTATE.printWarnings(FALSE);
      DBMS_XMLSCHEMA_ANNOTATE.disableDefaultTableCreation(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.SETTIMESTAMPWITHTIMEZONE(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.SETTIMESTAMPWITHTIMEZONE(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.disableMaintainDom(V_XML_SCHEMA,FALSE);
      DBMS_XMLSCHEMA.registerSchema(
        SCHEMAURL       => V_SCHEMA_LOCATION_HINT
       ,SCHEMADOC       => V_XML_SCHEMA
       ,LOCAL           => TRUE
       ,GENTYPES        => TRUE
       ,GENTABLES       => TRUE
       ,ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
    end;
    declare
      V_XML_SCHEMA_NAME       VARCHAR2(700) := 'Admin.xsd';
      V_XML_SCHEMA             XMLType       := xmlType(BfileName('XSD_DIR',V_XML_SCHEMA_NAME),nls_charset_id('AL32UTF8'));
      V_SCHEMA_LOCATION_HINT   VARCHAR2(700) := 'Admin.xsd';
    begin
      DBMS_XMLSCHEMA_ANNOTATE.printWarnings(FALSE);
      DBMS_XMLSCHEMA_ANNOTATE.disableDefaultTableCreation(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.SETTIMESTAMPWITHTIMEZONE(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.disableMaintainDom(V_XML_SCHEMA,FALSE);
      DBMS_XMLSCHEMA.registerSchema(
        SCHEMAURL       => V_SCHEMA_LOCATION_HINT
       ,SCHEMADOC       => V_XML_SCHEMA
       ,LOCAL           => TRUE
       ,GENTYPES        => TRUE
       ,GENTABLES       => TRUE
       ,ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
    end;
    declare
      V_XML_SCHEMA_NAME       VARCHAR2(700) := 'CoTotals.xsd';
      V_XML_SCHEMA             XMLType       := xmlType(BfileName('XSD_DIR',V_XML_SCHEMA_NAME),nls_charset_id('AL32UTF8'));
      V_SCHEMA_LOCATION_HINT   VARCHAR2(700) := 'CoTotals.xsd';
    begin
      DBMS_XMLSCHEMA_ANNOTATE.printWarnings(FALSE);
      DBMS_XMLSCHEMA_ANNOTATE.disableDefaultTableCreation(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.SETTIMESTAMPWITHTIMEZONE(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.disableMaintainDom(V_XML_SCHEMA,FALSE);
      DBMS_XMLSCHEMA.registerSchema(
        SCHEMAURL       => V_SCHEMA_LOCATION_HINT
       ,SCHEMADOC       => V_XML_SCHEMA
       ,LOCAL           => TRUE
       ,GENTYPES        => TRUE
       ,GENTABLES       => TRUE
       ,ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
    end;
    declare
      V_XML_SCHEMA_NAME       VARCHAR2(700) := 'Event.xsd';
      V_XML_SCHEMA             XMLType       := xmlType(BfileName('XSD_DIR',V_XML_SCHEMA_NAME),nls_charset_id('AL32UTF8'));
      V_SCHEMA_LOCATION_HINT   VARCHAR2(700) := 'Event.xsd';
    begin
      DBMS_XMLSCHEMA_ANNOTATE.printWarnings(FALSE);
      DBMS_XMLSCHEMA_ANNOTATE.disableDefaultTableCreation(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.SETTIMESTAMPWITHTIMEZONE(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.disableMaintainDom(V_XML_SCHEMA,FALSE);
      DBMS_XMLSCHEMA.registerSchema(
        SCHEMAURL       => V_SCHEMA_LOCATION_HINT
       ,SCHEMADOC       => V_XML_SCHEMA
       ,LOCAL           => TRUE
       ,GENTYPES        => TRUE
       ,GENTABLES       => TRUE
       ,ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
    end;
    declare
      V_XML_SCHEMA_NAME       VARCHAR2(700) := 'Image.xsd';
      V_XML_SCHEMA             XMLType       := xmlType(BfileName('XSD_DIR',V_XML_SCHEMA_NAME),nls_charset_id('AL32UTF8'));
      V_SCHEMA_LOCATION_HINT   VARCHAR2(700) := 'Image.xsd';
    begin
      DBMS_XMLSCHEMA_ANNOTATE.printWarnings(FALSE);
      DBMS_XMLSCHEMA_ANNOTATE.disableDefaultTableCreation(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.SETTIMESTAMPWITHTIMEZONE(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.disableMaintainDom(V_XML_SCHEMA,FALSE);
      DBMS_XMLSCHEMA.registerSchema(
        SCHEMAURL       => V_SCHEMA_LOCATION_HINT
       ,SCHEMADOC       => V_XML_SCHEMA
       ,LOCAL           => TRUE
       ,GENTYPES        => TRUE
       ,GENTABLES       => TRUE
       ,ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
    end;
    declare
      V_XML_SCHEMA_NAME       VARCHAR2(700) := 'Salvage.xsd';
      V_XML_SCHEMA             XMLType       := xmlType(BfileName('XSD_DIR',V_XML_SCHEMA_NAME),nls_charset_id('AL32UTF8'));
      V_SCHEMA_LOCATION_HINT   VARCHAR2(700) := 'Salvage.xsd';
    begin
      DBMS_XMLSCHEMA_ANNOTATE.printWarnings(FALSE);
      DBMS_XMLSCHEMA_ANNOTATE.disableDefaultTableCreation(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.SETTIMESTAMPWITHTIMEZONE(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.disableMaintainDom(V_XML_SCHEMA,FALSE);
      DBMS_XMLSCHEMA.registerSchema(
        SCHEMAURL       => V_SCHEMA_LOCATION_HINT
       ,SCHEMADOC       => V_XML_SCHEMA
       ,LOCAL           => TRUE
       ,GENTYPES        => TRUE
       ,GENTABLES       => TRUE
       ,ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
    end;
    declare
      V_XML_SCHEMA_NAME       VARCHAR2(700) := 'TotalLoss.xsd';
      V_XML_SCHEMA             XMLType       := xmlType(BfileName('XSD_DIR',V_XML_SCHEMA_NAME),nls_charset_id('AL32UTF8'));
      V_SCHEMA_LOCATION_HINT   VARCHAR2(700) := 'TotalLoss.xsd';
    begin
      DBMS_XMLSCHEMA_ANNOTATE.printWarnings(FALSE);
      DBMS_XMLSCHEMA_ANNOTATE.disableDefaultTableCreation(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.SETTIMESTAMPWITHTIMEZONE(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.disableMaintainDom(V_XML_SCHEMA,FALSE);
      DBMS_XMLSCHEMA.registerSchema(
        SCHEMAURL       => V_SCHEMA_LOCATION_HINT
       ,SCHEMADOC       => V_XML_SCHEMA
       ,LOCAL           => TRUE
       ,GENTYPES        => TRUE
       ,GENTABLES       => TRUE
       ,ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
    end;
    declare
      V_XML_SCHEMA_NAME        VARCHAR2(700) := 'Vins.xsd';
      V_XML_SCHEMA             XMLType       := xmlType(BfileName('XSD_DIR',V_XML_SCHEMA_NAME),nls_charset_id('AL32UTF8'));
      V_SCHEMA_LOCATION_HINT   VARCHAR2(700) := 'Vins.xsd';
    begin
      DBMS_XMLSCHEMA_ANNOTATE.printWarnings(FALSE);
      DBMS_XMLSCHEMA_ANNOTATE.disableDefaultTableCreation(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.SETTIMESTAMPWITHTIMEZONE(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.disableMaintainDom(V_XML_SCHEMA,FALSE);
      -- DOM Fidelity enabled due to presence of mixed text, substitution group heads, or repeating choice structures in complex type defintion :-
      DBMS_XMLSCHEMA_ANNOTATE.enableMaintainDOM(V_XML_SCHEMA,'RefurbMgr',TRUE);
      select /*+ NO_XML_QUERY_REWRITE */
             XMLQuery(
               'declare namespace xdb = "http://xmlns.oracle.com/xdb"; (:
                copy $NEWSCH := $SCHEMA modify (
                                          let $MODEL := $NEWSCH/xs:schema/xs:complexType[11]/xs:all
                                          return (
                                            replace value of node $MODEL/xs:element[2]/xs:complexType/@xdb:maintainDOM with "false",
                                            replace value of node $MODEL/xs:element[3]/xs:complexType/@xdb:maintainDOM with "false",
                                            replace value of node $MODEL/xs:element[4]/xs:complexType/@xdb:maintainDOM with "false"
                 return $NEWSCH'
               passing V_XML_SCHEMA as "SCHEMA"
               returning content
        into V_XML_SCHEMA
        from dual;
      DBMS_XMLSCHEMA.registerSchema(
        SCHEMAURL       => V_SCHEMA_LOCATION_HINT
       ,SCHEMADOC       => V_XML_SCHEMA
       ,LOCAL           => TRUE
       ,GENTYPES        => TRUE
       ,GENTABLES       => TRUE
       ,ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
    end;
    declare
      V_XML_SCHEMA_NAME       VARCHAR2(700) := 'corr.xsd';
      V_XML_SCHEMA             XMLType       := xmlType(BfileName('XSD_DIR',V_XML_SCHEMA_NAME),nls_charset_id('AL32UTF8'));
      V_SCHEMA_LOCATION_HINT   VARCHAR2(700) := 'corr.xsd';
    begin
      DBMS_XMLSCHEMA_ANNOTATE.printWarnings(FALSE);
      DBMS_XMLSCHEMA_ANNOTATE.disableDefaultTableCreation(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.SETTIMESTAMPWITHTIMEZONE(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.disableMaintainDom(V_XML_SCHEMA,FALSE);
      DBMS_XMLSCHEMA.registerSchema(
        SCHEMAURL       => V_SCHEMA_LOCATION_HINT
       ,SCHEMADOC       => V_XML_SCHEMA
       ,LOCAL           => TRUE
       ,GENTYPES        => TRUE
       ,GENTABLES       => TRUE
       ,ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
    end;
    declare
      V_XML_SCHEMA_NAME       VARCHAR2(700) := 'estimate.xsd';
      V_XML_SCHEMA             XMLType       := xmlType(BfileName('XSD_DIR',V_XML_SCHEMA_NAME),nls_charset_id('AL32UTF8'));
      V_SCHEMA_LOCATION_HINT   VARCHAR2(700) := 'estimate.xsd';
    begin
      DBMS_XMLSCHEMA_ANNOTATE.printWarnings(FALSE);
      DBMS_XMLSCHEMA_ANNOTATE.disableDefaultTableCreation(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.SETTIMESTAMPWITHTIMEZONE(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.disableMaintainDom(V_XML_SCHEMA,FALSE);
      DBMS_XMLSCHEMA.registerSchema(
        SCHEMAURL       => V_SCHEMA_LOCATION_HINT
       ,SCHEMADOC       => V_XML_SCHEMA
       ,LOCAL           => TRUE
       ,GENTYPES        => TRUE
       ,GENTABLES       => TRUE
       ,ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
    end;
    declare
      V_XML_SCHEMA_NAME       VARCHAR2(700) := 'notes.xsd';
      V_XML_SCHEMA             XMLType       := xmlType(BfileName('XSD_DIR',V_XML_SCHEMA_NAME),nls_charset_id('AL32UTF8'));
      V_SCHEMA_LOCATION_HINT   VARCHAR2(700) := 'notes.xsd';
    begin
      DBMS_XMLSCHEMA_ANNOTATE.printWarnings(FALSE);
      DBMS_XMLSCHEMA_ANNOTATE.disableDefaultTableCreation(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.SETTIMESTAMPWITHTIMEZONE(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.disableMaintainDom(V_XML_SCHEMA,FALSE);
      DBMS_XMLSCHEMA.registerSchema(
        SCHEMAURL       => V_SCHEMA_LOCATION_HINT
       ,SCHEMADOC       => V_XML_SCHEMA
       ,LOCAL           => TRUE
       ,GENTYPES        => TRUE
       ,GENTABLES       => TRUE
       ,ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
    end;
    declare
      V_XML_SCHEMA_NAME       VARCHAR2(700) := 'rate.xsd';
      V_XML_SCHEMA             XMLType       := xmlType(BfileName('XSD_DIR',V_XML_SCHEMA_NAME),nls_charset_id('AL32UTF8'));
      V_SCHEMA_LOCATION_HINT   VARCHAR2(700) := 'rate.xsd';
    begin
      DBMS_XMLSCHEMA_ANNOTATE.printWarnings(FALSE);
      DBMS_XMLSCHEMA_ANNOTATE.disableDefaultTableCreation(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.SETTIMESTAMPWITHTIMEZONE(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.disableMaintainDom(V_XML_SCHEMA,FALSE);
      DBMS_XMLSCHEMA.registerSchema(
        SCHEMAURL       => V_SCHEMA_LOCATION_HINT
       ,SCHEMADOC       => V_XML_SCHEMA
       ,LOCAL           => TRUE
       ,GENTYPES        => TRUE
       ,GENTABLES       => TRUE
       ,ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
    end;
    declare
      V_XML_SCHEMA_NAME       VARCHAR2(700) := 'workfile.xsd';
      V_XML_SCHEMA             XMLType       := xmlType(BfileName('XSD_DIR',V_XML_SCHEMA_NAME),nls_charset_id('AL32UTF8'));
      V_SCHEMA_LOCATION_HINT   VARCHAR2(700) := 'workfile.xsd';
    begin
      DBMS_XMLSCHEMA_ANNOTATE.printWarnings(FALSE);
      DBMS_XMLSCHEMA_ANNOTATE.disableDefaultTableCreation(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.SETTIMESTAMPWITHTIMEZONE(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.disableMaintainDom(V_XML_SCHEMA,FALSE);
      -- Out-of-Line mappings for 1000 Column optimization :-
      DBMS_XMLSCHEMA_ANNOTATE.setOutOfLine(V_XML_SCHEMA,DBMS_XDB_CONSTANTS.XSD_COMPLEX_TYPE,'WorkfileType', 'AdminComp','ADMINCOMP_XML');
      DBMS_XMLSCHEMA_ANNOTATE.setOutOfLine(V_XML_SCHEMA,DBMS_XDB_CONSTANTS.XSD_COMPLEX_TYPE,'WorkfileType', 'NotesComp','NOTESCOMP_XML');
      DBMS_XMLSCHEMA_ANNOTATE.setOutOfLine(V_XML_SCHEMA,DBMS_XDB_CONSTANTS.XSD_COMPLEX_TYPE,'WorkfileType', 'SalvageComp','SALVGCOMP_XML');
      DBMS_XMLSCHEMA_ANNOTATE.setOutOfLine(V_XML_SCHEMA,DBMS_XDB_CONSTANTS.XSD_COMPLEX_TYPE,'WorkfileType', 'CorrComp','CORRCOMP_XML');
      DBMS_XMLSCHEMA_ANNOTATE.setOutOfLine(V_XML_SCHEMA,DBMS_XDB_CONSTANTS.XSD_COMPLEX_TYPE,'WorkfileType', 'ImageComp','IMAGECOMP_XML');
      DBMS_XMLSCHEMA_ANNOTATE.setOutOfLine(V_XML_SCHEMA,DBMS_XDB_CONSTANTS.XSD_COMPLEX_TYPE,'WorkfileType', 'EventInterfaceManagerComp','EVIFCMGRCOMP_XML');
      DBMS_XMLSCHEMA_ANNOTATE.setOutOfLine(V_XML_SCHEMA,DBMS_XDB_CONSTANTS.XSD_COMPLEX_TYPE,'WorkfileType', 'TotalLossComp','TOTALLOSSCOMP_XML');
      DBMS_XMLSCHEMA.registerSchema(
        SCHEMAURL       => V_SCHEMA_LOCATION_HINT
       ,SCHEMADOC       => V_XML_SCHEMA
       ,LOCAL           => TRUE
       ,GENTYPES        => TRUE
       ,GENTABLES       => TRUE
       ,ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
    end;
    -- Table creation for namespace "http://www.cccis.com/Pathways/Workfile"
    set lines 80
    CREATE TABLE "PWAYWORKFILE_TABLE"
          SequenceID NUMBER,
          DL_CLM_FOLDER_ID   VARCHAR2(30),
          CUST_CLM_REF_ID VARCHAR(25),
          ems_file_nm               varchar2(256),
          EST_IND         VARCHAR2(3),
          rec_dt date default sysdate,
          filesent_datetime date,
          CLM_TYP_CD               VARCHAR2(2 CHAR),
          WORKFILE  XMLTYPE
    XMLTYPE COLUMN WORKFILE
    STORE AS OBJECT RELATIONAL
    XMLSCHEMA "workfile.xsd" ELEMENT "PwayWorkfile"
    create sequence PWAYWORKFILE_TABLE_SEQ
    start with 1
    increment by 1
    nomaxvalue
    create trigger PWAYWORKFILE_TABLE_TRIGGER
    before insert on PWAYWORKFILE_TABLE
    for each row
    begin
    select PWAYWORKFILE_TABLE_SEQ.nextval into :new.SequenceID from dual;
    end;
    desc PWAYWORKFILE_TABLE
    /* create synonym */
    create or replace public synonym PWAYWORKFILE_TABLE for PWAYWORKFILE_TABLE;
    grant select on PWAYWORKFILE_TABLE to BIUSER_RO;
    grant select, insert, update,delete on PWAYWORKFILE_TABLE to biuser_full;
    exit;
    Regards,
    Arghyadip

    Hi MarcoGralike,
    I have finally acquired a sample schema and xmls to reproduce the errors that i am getting even after acquiring XDBADMIN privilege and registering my schema as GLOBAL.
    Here's the problem i am facing, whenever i intend to store the PublisherList (publisher.xsd) out of line while registration i am running into insufficient privilege issues even if i have the schema registered using (LOCAL => FALSE), whereas it runs smooth in BIUSER and if i dont set it out of line it works in ETLUSER as well.
    Here are the 2 XSD files
    books.xsd   --- this is the root element
    <xs:schema  xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb"  version="1.0" xdb:storeVarrayAsTable="true">
      <xs:include schemaLocation="publisher.xsd"/>
      <xs:element name="books" type="bookType"/>
      <xs:complexType name="bookType" abstract="true">
        <xs:sequence>
        <xs:element name="author" type="xs:string" minOccurs="0"/>
        <xs:element name="title" type="xs:string" minOccurs="0"/>
        <xs:element name="genre" type="xs:string" minOccurs="0"/>
        <xs:element ref="PublisherList" minOccurs="0"/>
       </xs:sequence>
       </xs:complexType>
    </xs:schema>
    publisher.xsd -- this is a child elelment which in my actual scenario is so big that i must keep it out of line during registration
    <xs:schema  xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb"  version="1.0" xdb:storeVarrayAsTable="true">
      <xs:element name="PublisherList" type="PublisherListType"/>
      <xs:complexType name="PublisherListType">
        <xs:sequence>
        <xs:element name="Name" type="xs:string" minOccurs="0"/>
        <xs:element name="Office" type="xs:string" minOccurs="0"/>
       </xs:sequence>
       </xs:complexType>
    </xs:schema>
    Here's the sample XML
    <?xml version="1.0"?>
    <books xmlns:xs="http://www.w3.org/2001/XMLSchema">
          <author>Writer</author>
          <title>The First Book</title>
          <genre>Fiction</genre>
          <PublisherList>
           <Name>Penguin</Name>
           <Office>London</Office>
          </PublisherList>
    </books>
    Here's how i am registering the Schemas in BIUSER which has XDBADMIN privilege
    DROP TABLE BOOKS_TABLE;
    begin
    dbms_xmlschema.deleteschema('books.xsd',dbms_xmlschema.DELETE_CASCADE);
    end;
    begin
    dbms_xmlschema.deleteschema('publisher.xsd',dbms_xmlschema.DELETE_CASCADE);
    end;
    declare
      V_XML_SCHEMA_NAME       VARCHAR2(700) := 'publisher.xsd';
      V_XML_SCHEMA             XMLType       := xmlType(BfileName('XSD_DIR',V_XML_SCHEMA_NAME),nls_charset_id('AL32UTF8'));
      V_SCHEMA_LOCATION_HINT   VARCHAR2(700) := 'publisher.xsd';
    begin
      DBMS_XMLSCHEMA_ANNOTATE.printWarnings(FALSE);
      DBMS_XMLSCHEMA_ANNOTATE.disableDefaultTableCreation(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.SETTIMESTAMPWITHTIMEZONE(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.disableMaintainDom(V_XML_SCHEMA,FALSE);
        DBMS_XMLSCHEMA.registerSchema(
        SCHEMAURL       => V_SCHEMA_LOCATION_HINT
       ,SCHEMADOC       => V_XML_SCHEMA
       ,LOCAL           => FALSE
       ,GENTYPES        => TRUE
       ,GENTABLES       => TRUE
       ,ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
    end;
    declare
      V_XML_SCHEMA_NAME       VARCHAR2(700) := 'books.xsd';
      V_XML_SCHEMA             XMLType       := xmlType(BfileName('XSD_DIR',V_XML_SCHEMA_NAME),nls_charset_id('AL32UTF8'));
      V_SCHEMA_LOCATION_HINT   VARCHAR2(700) := 'books.xsd';
    begin
      DBMS_XMLSCHEMA_ANNOTATE.printWarnings(FALSE);
      DBMS_XMLSCHEMA_ANNOTATE.disableDefaultTableCreation(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.SETTIMESTAMPWITHTIMEZONE(V_XML_SCHEMA);
      DBMS_XMLSCHEMA_ANNOTATE.disableMaintainDom(V_XML_SCHEMA,FALSE);
    DBMS_XMLSCHEMA_ANNOTATE.setOutOfLine(V_XML_SCHEMA,DBMS_XDB_CONSTANTS.XSD_COMPLEX_TYPE,'bookType', 'PublisherList','PUBLISHERLIST_XML');
        DBMS_XMLSCHEMA.registerSchema(
        SCHEMAURL       => V_SCHEMA_LOCATION_HINT
       ,SCHEMADOC       => V_XML_SCHEMA
       ,LOCAL           => FALSE
       ,GENTYPES        => TRUE
       ,GENTABLES       => TRUE
       ,ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
    end;
    CREATE TABLE BOOKS_TABLE
          BOOKS  XMLTYPE
    XMLTYPE COLUMN BOOKS
    STORE AS OBJECT RELATIONAL
    XMLSCHEMA "books.xsd" ELEMENT "books"
    DROP PUBLIC SYNONYM BOOKS_TABLE;
    create or replace public synonym BOOKS_TABLE for BOOKS_TABLE;
    grant select, insert, update,delete on BOOKS_TABLE to ETLUSER;
    Heres the ctl file that i am using
    Load_Books.ctl
    OPTIONS (ERRORS=100000, SILENT=(HEADER,FEEDBACK),ROWS=500, BINDSIZE=3072000 , READSIZE=3072000)
    load data
    infile '/apps/dev/PWXML-10/ctl/load_xml.txt'
    BADFILE '/apps/dev/PWXML-10/ctl/load_xml.txt.bad'
    DISCARDFILE '/apps/dev/PWXML-10/ctl/load_xml.txt.dsc'
    append
    into table BOOKS_TABLE
    filename filler char(120),
    BOOKS lobfile(filename) terminated by eof)
    '/apps/dev/PWXML-10/ctl/load_xml.txt' would contain the XML file path that i gave
    Heres how i am loading the XML through sqlldr in ETLUSER
    sqlldr etluser/etluserpassword@MYXMLDBNAME control=Load_Books.ctl log=Load_Books.ctl.log
    Here's the error i am getting
    Record 1: Rejected - Error on table "BIUSER"."BOOKS_TABLE".
    ORA-00604: error occurred at recursive SQL level 1
    ORA-01031: insufficient privileges
    Hopefully i have given you all the set up required to pin point the evil error.
    Please let me know if i have missed something.

  • Problem query of XMLType column in XSQL servlet

    Hi all,
    I'm having trouble debugging the following error from a query on an XMLType column in an XSQL page query:
    <page xmlns:xsql="urn:oracle-xsql" connection="jdbc/DBConnection1DS">
    <xsql:query max-rows="1" null-indicator="no">
    SELECT extractValue(x.DOCBOOKS_DOC, '/book/part/title', 'xmlns="http://docbook.org/ns/docbook"') "BOOK TITLE"
    FROM DOCBOOKS_STORE x
    </xsql:query>
    </page>
    which returns the following error message:
    <page>
    <ERROR>
    oracle.xml.sql.OracleXMLSQLException: Character ' ' is not allowed in an XML tag name.
    </ERROR>
    </page>
    The SQL query works fine in the SQL Worksheet and SQL Plus, only when I stick it in an XSQL query. I've tested the XSQL Page environment with a query on Number Datatype column and no issues there either.
    Any suggestions, much appreciated. Thanks.
    George

    The XML SQL Utility creates XML tags named after your column aliases.
    You have aliased the column to a name containing a space: "BOOK TITLE"
    This error is telling you that the implied XML element whose name matches this column alias, which would be <BOOK TITLE> is not a legal name for an XML element since it has a space in it.
    You'll need to pick a column alias with no space in the name. For example, "BOOK_TITLE" and then in your XSLT stylesheet (or whatever downstream formatting tool you may be using) remove the underscore from the name and replace it with a space.

  • Update query for XMLTYPE column

    Hello everyone,
    I have inserted xml data into XMLTYPE column of my table,xml data is something like this
    <Data type="FYI">                         
    <ID xmlns="http://orcl.com">T-1-1</ID>
    <Category>FRAME</Category>
    <ProductID>1</ProductID>
    <Name xmlns="http://orcl.com">Frame </Name>
    <Type>BASIC</Type>
    <Code>INSTALL</Code>
    <NodeID>1</NodeID>
    </Data>
    Now i need to update the values inside the <Data> element,like
    ID == T-2-2
    Category == IFRAME
    ProductID == 1.1
    Name == IFRAME
    We are using oracle 10g R2.
    Please help me out how to update. It would be very thankfull for your valuble suggestions
    Thanks in advance

    <Services>
    <DataService type="FRLY">
    <ID xmlns="http://www.openapplications.org/oagis/9">T-1-1-FRLY</ID>
    <CategoryCode>FRAME</CategoryCode>
    <ProductOfferingID>1</ProductOfferingID>
    <Name xmlns="http://www.openapplications.org/oagis/9">Frame Relay</Name>
    <SubType>FRLY - BASIC</SubType>
    <ActionCode>INSTALL</ActionCode>
    <NodeID>1</NodeID>
    <Contract>
    <ID xmlns="http://www.openapplications.org/oagis/9" schemeName="Networx Universal">00000</ID>
    <Category name="Contract Type">U</Category>
    </Contract>
    <Contract>
    <Type xmlns="http://www.openapplications.org/oagis/9">Routine</Type>
    </Contract>
    <CustomerParty>
    <Location/>
    </CustomerParty>
    <ProvisioningStatus type="BillingSetup">
    <Description xmlns="http://www.openapplications.org/oagis/9">C</Description>
    </ProvisioningStatus>
    <MileStone>
    <ID xmlns="http://www.openapplications.org/oagis/9">CWD</ID>
    <Date>2007-01-29</Date>
    </MileStone>
    <ActivityStatus>
    <Code xmlns="http://www.openapplications.org/oagis/9" name="DueDate"/>
    <EffectiveDateTime xmlns="http://www.openapplications.org/oagis/9">2007-01-29T00:00:00Z</EffectiveDateTime>
    </ActivityStatus>
    <AssociatedIDs>
    <ID xmlns="http://www.openapplications.org/oagis/9">1</ID>
    </AssociatedIDs>
    <AssociatedIDs>
    <TemporaryID schemeName="OPKEY">34908</TemporaryID>
    </AssociatedIDs>
    <Location>
    <ID xmlns="http://www.openapplications.org/oagis/9">T-510092</ID>
    </Location>
    <OrderID>RequestID</OrderID>
    <Accessory>
    <ActionCode>ADD</ActionCode>
    <Description xmlns="http://www.openapplications.org/oagis/9">IBM ESERVER-XSERIES306</Description>
    <CategoryCode>5</CategoryCode>
    <InstallVendorParty>
    <Name xmlns="http://www.openapplications.org/oagis/9">MCI</Name>
    </InstallVendorParty>
    </Accessory>
    <Circuit>
    <ID xmlns="http://www.openapplications.org/oagis/9">T-1-1-FRLY</ID>
    <AssociatedIDs/>
    </Circuit>
    </DataService>
    </Services>
    This was my xml which i have inserted into DB for the column XMLTYPE.Now i need to update few values in this whole file like values of
    ID under<DataService>
    Name under <DataService>
    ID under <Contract>
    Description under <ProvisioningStatus>
    i was using the UPDATEXML query to update those it's saying i row updated but when i extract it says null.
    Please help me out to solve this problem.
    Thanks in advance.

  • Is there any manual about using DB2 as storage of Oracle BPEL Manager?

    Hi
    thank you for reading my post
    Is there any manual about using DB2 as database of ORACLE BPEL manager ?
    any one tried to port and test the system on DB2?
    Thanks.

    Hi,
    as you can read in the manual:
    http://download-east.oracle.com/docs/cd/B31017_01/integrate.1013/b28980/overview.htm#sthref26
    Oracle Database Lite, if you use the SOA Suite Basic installation option
    Oracle Database Lite is configured to support Unicode. DB_CHAR_ENCODING is defaulted to UTF8 in the polite.ini file.
    Oracle9i Database Server
    Oracle Database 10g
    The BPEL schema includes PL/SQL packages. They will not run on DB2...
    The datasources are configured to Oracle. You will have to change them to DB2...
    and it is not supported ;-)

  • XMLDB query on XmlType Column.

    Hi,
    I’ve some problems.
    I’ve some search queries which are working on normal relation table, but I don’t know how it works on XMLDB(Oracle 10gR2)
    Structure of XML file
    My xml table structure will be :
    Create table <tablename>
    Person_Id number primary key,
    Person_BankName varchar2,
    DateOfEntry date,
    Xmlcol xmltype
    Xmlcol xmltype will be mapped to a schema for the below xml file.
    XML File
    <Person>
         <Information>
              <firstname>Suchendra</firstname>
              <lastname>Kumar</lastname>
              <middlename>Krishna</middlename>
         </Information>
         <Account>
              <accountno>12212</accountno>
              <balance>42323.89</balance>
              <opendate>12-03-2005</opendate>
         </Account>
         <Transaction>
              <transamount>1000</transamount>
              <balance>41323.89</balance>
              <trandate>14-03-2005</ trandate >
              <trantime>10:40:22</trantime>
         </ Transaction >
    </Person>
    SQL Queries Required
    1.     Query to fetch the records whose transaction has been done from date 12-03-2001 to date 01-01-2005.
    2.     Query to fetch the records whose lastname= “*Kumar”
    3.     Query to fetch the records whose transaction has been done from time 9:09:55 to time12:26:23.
    4.     Query to fetch the records whose balance > 4000 and balance < 5000.
    5.     Regular expression Search in XMLDB. Ex: searching for records whose firstname has ‘su*’ or ‘*ab’ in it.
    Can anyone help me in this..
    Thanks
    Athar

    1. select *
    from <tablename>
    where extractValue(Xmlcol, '/Person/trandate') is between '12-03-2001' and '01-01-2005';
    2. select *
    from <tablename>
    where extractValue(Xmlcol, '/Person/lastname') like '*Kumar';
    3. select *
    from <tablename>
    where extractValue(Xmlcol, '/Person/trantime') is between '9:09:55' and '12:26:23';
    4. select *
    from <tablename>
    where extractValue(Xmlcol, '/Person/balance') > 4000'
    and extractValue(Xmlcol, '/Person/balance') < 5000;
    5. select *
    from <tablename>
    where extractValue(Xmlcol, '/Person/firstname') like 'su*'
    or extractValue(Xmlcol, '/Person/firstname') like ‘*ab’;
    Regards,
    Kamal Shrivastava

  • XMLTYPE as CLOB storage "inserting large xml document in xml type column"

    Hi All,
    i have a table containing an xml datatype(non schema based)
    i would like to insert a large xml document in it
    but an exception is thrown-->"string literal too long"
    i tried to use bind variables as a solution"prepared statements as i write in java"
    but it didn't work....as xml document is large
    when i tried to change the column type to CLOB,it worked but without xml validataion,
    although the xml type is mapped to a CLOB in storage, xml type couldn't insert the document
    if anyone have a solution plz tell,i needed it urgently
    thanks,in advance :-)

    thx it was very useful :-)
    but i am not having any success getting the following statement working using a JDBC connection pool rather than a hard coded URL connection
    tempClob = CLOB.createTemporary(conn, true, CLOB.DURATION_SESSION);
    it works with:
    "jdbc:oracle:thin:@server:port:dbname"
    Does NOT work with:
    datasource.getConnection()
    if anyone colud help...

  • Multiple XML schema in structured XMLType column possible?

    I have registered several different xml schema in my 10g database. I have a table with an XMLType column. That column will always hold one XML document that conforms to one of the XML schema. Question: does that by definition mean I have to use "unstructured" storage, or there any way to use structured storage telling Oracle that the XMLType conforms to xsd1 OR xsd2 OR xsd3?
    Thanks.

    In 10gR2 a column based on an XML Schema and using object-relation storage can be bound to one global element. The only way for a column to hold documents associated with more than one global element is if both elements are defined as members of the same substition group.

  • XMLtype column report query

    I want to have a user input information into a text box and use the information to query my xmltype column (Oracle 11g) to extract data from a few of the tags and generate a report. From what I can tell APEX query builders for generating reports do not allow you to use xmltype columns. Is there another way to do this? I can write xml queries in SQL but I don’t know how to take the results and make a report in APEX. Does anyone know how to do this? Thanks!

    Wrong forum.. queries using contains should be posted in the oracle text forum..

  • Difference between an XMLType table and a table with an XMLType column?

    Hi all,
    Still trying to get my mind around all this XML stuff.
    Can someone concisely explain the difference between:
    create table this_is_xmltype_tab of xmltype;and
    create table this_is_tab_w_xmltpe_col(id number, document xmltype);What are the relative advantages and disadvantages of each approach? How do they really differ?
    Thanks,
    -Mark

    There is another pointer Mark, that I realized when I was thinking about the differences...
    If you would look up in the manual regarding "xdb:annotations" you would learn about a method using an XML Schema to generate out of the box your whole design in terms of physical layout and/or design principles. In my mind this should be the preferred solution if you are dealing with very complex XML Schema environments. Taking your XML Schema as your single point design layout, that during the actual implementation automatically generates and builds all your needed database objects and its physical requirements, has great advantages in points of design version management etc., but...
    ...it will create automatically an XMLType table (based on OR, Binary XML of "hybrid" storage principles, aka the ones that are XML Schema driven) and not AFAIK a XMLtype column structure: so as in "our" case a table with a id column and a xmltype column.
    In principle you could relationally relate to this as:
    +"I have created an EER diagram and a Physical diagram, I mix the content/info of those two into one diagram." "Then I _+execute+_ it in the database and the end result will be an database user/schema that has all the xxxx amount of physical objects I need, the way I want it to be...".+
    ...but it will be in the form of an XMLType table structure...
    xdb:annotations can be used to create things like:
    - enforce database/company naming conventions
    - DOM validation enabled or not
    - automatic IOT or BTree index creation (for instance in OR XMLType storage)
    - sort search order enforced or not
    - default tablenames and owners
    - extra column or table property settings like for partitioning XML data
    - database encoding/mapping used for SQL and binary storage
    - avoid automatic creation of Oracle objects (tables/types/etc), for instance, via xdb:defaultTable="" annotations
    - etc...
    See here for more info: http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10492/xdb05sto.htm#ADXDB4519
    and / or for more detailed info:
    http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10492/xdb05sto.htm#i1030452
    http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10492/xdb05sto.htm#i1030995
    http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10492/xdb05sto.htm#CHDCEBAG
    ...

  • Cannot display complete document in binary XML XMLType column

    I've been trying to get a query to work that will display the complete XML document stored in a column of XMLType, binary XML storage.
    <b/>
    I"m using Toad 10.6.1.3.
    <b/>
    I'm running Oracle client:
    {code}Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE 11.1.0.7.0 Production
    TNS for Linux: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - Production{code}
    <b/>
    The table is defined:
    {code}CREATE TABLE AUDITED_EVENT_XML_MIN (
    AUDITED_EVENT_XML_PK_ID NUMBER(10) PRIMARY KEY,
    /* The time the audit record was created. */
    CREATED_TIME TIMESTAMP(6) WITH LOCAL TIME ZONE NOT NULL,
    /* Well-formed XML message */
    XML_EVENT_CONTENT XMLType
    XMLTYPE COLUMN "XML_EVENT_CONTENT" STORE AS BINARY XML;
    {code}
    <b/>
    The XML has no namespace. The SQL that I tried is:
    {code}select e.xml_event_content.extract('/') from AUDITED_EVENT_XML e;{code}
    <b/>
    I also tried a simpler approach.
    {code}select * from AUDITED_EVENT_XML e;{code}
    <b/>
    and got this error:
    {code}ORA-21500: internal error code, arguments: [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s]{code}
    <b/>
    I'm a newbie; I'm sure there is a simple way to do this; but I can't find it in the Oracle XML DB Developers Guide.
    It would also be helpful to know how to do this for documents that have a declared namespace (without a xsd schema)...
    Thanks in advance...
    Edited by: flyeagle5683 on Sep 4, 2012 3:18 PM

    When ran from the Command window in PL/SQL Developer
    Connected to Oracle Database 11g Enterprise Edition Release 11.1.0.6.0
    SQL>
    SQL> CREATE TABLE AUDITED_EVENT_XML_MIN (
      2      AUDITED_EVENT_XML_PK_ID NUMBER(10) PRIMARY KEY,
      3      /* The time the audit record was created. */
      4      CREATED_TIME TIMESTAMP(6) WITH LOCAL TIME ZONE NOT NULL,
      5      /* Well-formed XML message */
      6      XML_EVENT_CONTENT XMLType
      7      )
      8      XMLTYPE COLUMN "XML_EVENT_CONTENT" STORE AS BINARY XML;
    Table created
    SQL> insert into audited_event_xml_min values (1, systimestamp, xmltype('<root><child1>Val1</child1></root>'));
    1 row inserted
    SQL> commit;
    Commit complete
    SQL> select * from AUDITED_EVENT_XML_MIN e;
    AUDITED_EVENT_XML_PK_ID CREATED_TIME                                      XML_EVENT_CONTENT
                          1 05-SEP-12 09.24.36.546435 AM                      <root>
                                                                                <child1>Val1</child1>
                                                                              </root>
    SQL> select e.xml_event_content.extract('/') from AUDITED_EVENT_XML_MIN e;
    E.XML_EVENT_CONTENT.EXTRACT('/
    <root>
      <child1>Val1</child1>
    </root>
    SQL> I also ran the two SELECT statements from SQL*Plus, (11.2.0.3 32-bit Instant Client) and received the exact same results.
    I'm guessing your version of Toad (or something between it and the DB) does not like XMLType data types being returned.
    Try
    select e.xml_event_content.extract('/').getStringVal() from AUDITED_EVENT_XML_MIN e;or .getClobVal() if the XML is large and see what happens.

  • Structured Storage

    I have a very simple schema registered called "Books.xsd" with a targetNamespace. This generated the user_xml_table Books4576_TAB.
    I've also created a table BOOKS with an XMLType column and can successfully insert an XML file with a schemaLocation with the targetNamespace and Books.xsd.
    A select from the BOOKS table's XMLType column yields a CLOB of XML. However, a select of the Books4576_TAB table yields no rows. I don't think structured storage is being successfully applied on my insert and the default table is not being populated.
    If I am using structured storage correctly, should the relational tables generated by the register schema command be populated when I perform an insert?

    No, you have LOB based storage for the table you created....
    You need to look at the DDL for the table generated using register Schema and then modify that DDL to create the relational table with the XMLType column. You need to understand that the storeVarrayAsTable directive only applies to the table generated by registerSchema, not to any XMLType tables or columns that are created after the XML Schema is registered.

  • Problem reading a xmlType column (return only 999 rows) with XMLTable

    Hello,
    I'm new in the forum.
    Sorry for my english.
    I have a problem reading an xmltype column.
    My oracle's version is 11.1.0.6.0
    I have a table like this:
    Create Table TestXml (idProg number, xmldata XmlType)
    XMLTYPE COLUMN xmldata
    STORE AS BINARY XML;
    I have a xml file containing the equivalent of 10000 record (like a csv).
    my schema xsd is the following:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
         <xs:element name="applicazione">
              <xs:annotation>
                   <xs:documentation>Flusso Monitoraggi</xs:documentation>
              </xs:annotation>
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="periodo" maxOccurs="unbounded">
                             <xs:complexType>
                                  <xs:sequence>
                                       <xs:element name="segmento" maxOccurs="unbounded">
                                            <xs:complexType>
                                                 <xs:sequence>
                                                      <xs:element name="progressivo" maxOccurs="unbounded">
                                                           <xs:complexType>
                                                                <xs:sequence>
                                                                     <xs:element name="stato" type="xs:string"/>
                                                                     <xs:element name="ts_start" type="xs:string"/>
                                                                     <xs:element name="ts_stop" type="xs:string"/>
                                                                     <xs:element name="nota_esecuzione" type="xs:string"/>
                                                                     <xs:element name="ts_esecuzione" type="xs:string"/>
                                                                </xs:sequence>
                                                                <xs:attribute name="valore" type="xs:integer" use="required"/>
                                                           </xs:complexType>
                                                      </xs:element>
                                                 </xs:sequence>
                                                 <xs:attribute name="nome" type="xs:string" use="required"/>
                                            </xs:complexType>
                                       </xs:element>
                                  </xs:sequence>
                                  <xs:attribute name="nome" type="xs:string" use="required"/>
                             </xs:complexType>
                        </xs:element>
                   </xs:sequence>
                   <xs:attribute name="nome" type="xs:string"/>
              </xs:complexType>
         </xs:element>
    </xs:schema>
    When I try to read my xmltype column with this select :
    SELECT ap.desc_applicazione,pe.seq_periodo, pe.desc_elem_temp_ist,
    sg.desc_segmento_elab,pg.seq_progressivo,
    pg.desc_stato,pg.ts_start,pg.ts_stop,pg.nota_esecuzione,pg.ts_esecuzione,
    pg.valore_prog,sg.seq_segmento,idProg
    FROM testXML p,
    XMLTable('/applicazione' PASSING p.xmlData
    COLUMNS
    seq_applicazione for ordinality,
    desc_applicazione VARCHAR2(50) PATH '@nome',
    periodo XMLType PATH 'periodo') ap,
    XMLTable('periodo' PASSING ap.periodo
    COLUMNS
    seq_periodo for ordinality,
    desc_elem_temp_ist VARCHAR2(50) PATH '@nome',
    segmento XMLType PATH 'segmento') pe,
    XMLTable('segmento' PASSING pe.segmento
    COLUMNS
    seq_segmento for ordinality,
    desc_segmento_elab VARCHAR2(50) PATH '@nome',
    progressivo XMLTYPE PATH 'progressivo') sg,
    XMLTable('progressivo' PASSING sg.progressivo
    COLUMNS
    seq_progressivo for ordinality,
    valore_prog NUMBER PATH '@valore',
    desc_stato VARCHAR(10) PATH 'stato',
    ts_start VARCHAR2(50) PATH 'ts_start',
    ts_stop VARCHAR2(50) PATH 'ts_stop',
    nota_esecuzione VARCHAR2(50) PATH 'nota_esecuzione',
    ts_esecuzione VARCHAR2(50) PATH 'ts_esecuzione'
    ) pg
    where idProg = 1
    I obtained only 999 rows.
    I tried with two file xml, one containing 10000 repetition of progressivo, the other containing 10000 repetition of segmento.
    Anybody know why? Where is my error?
    Thank you in advance for any response.
    Maurizio

    Hello,
    I'm new in the forum.
    Sorry for my english.
    I have a problem reading an xmltype column.
    My oracle's version is 11.1.0.6.0
    I have a table like this:
    Create Table TestXml (idProg number, xmldata XmlType)
    XMLTYPE COLUMN xmldata
    STORE AS BINARY XML;
    I have a xml file containing the equivalent of 10000 record (like a csv).
    my schema xsd is the following:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
         <xs:element name="applicazione">
              <xs:annotation>
                   <xs:documentation>Flusso Monitoraggi</xs:documentation>
              </xs:annotation>
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="periodo" maxOccurs="unbounded">
                             <xs:complexType>
                                  <xs:sequence>
                                       <xs:element name="segmento" maxOccurs="unbounded">
                                            <xs:complexType>
                                                 <xs:sequence>
                                                      <xs:element name="progressivo" maxOccurs="unbounded">
                                                           <xs:complexType>
                                                                <xs:sequence>
                                                                     <xs:element name="stato" type="xs:string"/>
                                                                     <xs:element name="ts_start" type="xs:string"/>
                                                                     <xs:element name="ts_stop" type="xs:string"/>
                                                                     <xs:element name="nota_esecuzione" type="xs:string"/>
                                                                     <xs:element name="ts_esecuzione" type="xs:string"/>
                                                                </xs:sequence>
                                                                <xs:attribute name="valore" type="xs:integer" use="required"/>
                                                           </xs:complexType>
                                                      </xs:element>
                                                 </xs:sequence>
                                                 <xs:attribute name="nome" type="xs:string" use="required"/>
                                            </xs:complexType>
                                       </xs:element>
                                  </xs:sequence>
                                  <xs:attribute name="nome" type="xs:string" use="required"/>
                             </xs:complexType>
                        </xs:element>
                   </xs:sequence>
                   <xs:attribute name="nome" type="xs:string"/>
              </xs:complexType>
         </xs:element>
    </xs:schema>
    When I try to read my xmltype column with this select :
    SELECT ap.desc_applicazione,pe.seq_periodo, pe.desc_elem_temp_ist,
    sg.desc_segmento_elab,pg.seq_progressivo,
    pg.desc_stato,pg.ts_start,pg.ts_stop,pg.nota_esecuzione,pg.ts_esecuzione,
    pg.valore_prog,sg.seq_segmento,idProg
    FROM testXML p,
    XMLTable('/applicazione' PASSING p.xmlData
    COLUMNS
    seq_applicazione for ordinality,
    desc_applicazione VARCHAR2(50) PATH '@nome',
    periodo XMLType PATH 'periodo') ap,
    XMLTable('periodo' PASSING ap.periodo
    COLUMNS
    seq_periodo for ordinality,
    desc_elem_temp_ist VARCHAR2(50) PATH '@nome',
    segmento XMLType PATH 'segmento') pe,
    XMLTable('segmento' PASSING pe.segmento
    COLUMNS
    seq_segmento for ordinality,
    desc_segmento_elab VARCHAR2(50) PATH '@nome',
    progressivo XMLTYPE PATH 'progressivo') sg,
    XMLTable('progressivo' PASSING sg.progressivo
    COLUMNS
    seq_progressivo for ordinality,
    valore_prog NUMBER PATH '@valore',
    desc_stato VARCHAR(10) PATH 'stato',
    ts_start VARCHAR2(50) PATH 'ts_start',
    ts_stop VARCHAR2(50) PATH 'ts_stop',
    nota_esecuzione VARCHAR2(50) PATH 'nota_esecuzione',
    ts_esecuzione VARCHAR2(50) PATH 'ts_esecuzione'
    ) pg
    where idProg = 1
    I obtained only 999 rows.
    I tried with two file xml, one containing 10000 repetition of progressivo, the other containing 10000 repetition of segmento.
    Anybody know why? Where is my error?
    Thank you in advance for any response.
    Maurizio

  • XML Schema based XMLType column leaves file open on error

    Hello,
    I have the following situation on both oracle 10.1.0.2.0 and 10.1.0.4.0:
    insert into xml_products (xmlfile) values(bfilename(file_loc, char_id));
    "xmlfile" is a xmltype column based on a registered xml schema.
    When the file fails xml schema validation, the file remains open and I cannot move it until i close the session.
    Is this a bug or an "intentional feature"?
    Any workarounds?
    Thanks,
    Flavio

    All right Mark,
    thanks for your reply.
    Meanwhile I fixed the problem and posted my workaround here:
    http://oraclequirks.blogspot.com/2005/11/ora-29292-and-xmltype.html
    Bye,
    Flavio

  • Query on XMLType! URGENT!!!

    Please, what the most efficient way to query a xmltype column?
    My xml's are 250KB ~ 1.5 MB and my table have over 130.000 records.
    I have tried:
    1) interMedia -> create index [indexname] on [table] (field) indextype is ctxsys.context parameters ('section group path_section_group')
    but results a error on creating...
    2) Table Functions, but a enough memory error results...
    3) create index on xpath directly, but the repetead tag's are discarded...
    I don't know what to do...
    Please, help me!!!
    Thanks...
    Marlon

    May be this is of some help -
    "compile error in hidden module: clBExevent bulider" error in BW 3.5!

Maybe you are looking for

  • How to remove values data points from Apex3 Flash Chart

    Hi I am using a Apex 3.2 and I have to put Flash Charts in my application. But since the charts have are smaller in size, I do not want to have the data points coming up in the chart. I have planned to show them using hints. But unfortunately, I am n

  • When I turn on my MacBook Pro I get a grey screen with a folder icon and a question mark. I can't the computer to boot up.

    What do I do when I power up the computer and get a grey screen with a folder icon and a question mark?

  • Simple Translate Q:

    Simple Translate Q: SELECT TRANSLATE('76051-9098','-','') FROM DUAL I need to get '760519098' off this.. When i give a ' ' -- Iam getting a ' ' inbetween(Obvious!!) But when i do '' -- A Null string is returned.. How do i overcome this.. Mohan.

  • Booklet Printing - HP 4600dn

    Hi - I am trying to do a Booklet Print of a 20-page pdf document, which appears to work successfully, except that the reverse pages are printed upside down. (i.e. back of page 1 is page 19 inverted). Printer is a HP 4600dn The document opens in Adobe

  • Dynamic Page parameters

    Please help. I have 2 dynamic pages and I want to pass parameters between them in the 1st dynamic page I have: <FORM METHOD=POST ACTION="url/owner.dyn_crt_login.show"> <INPUT TYPE=TEXT NAME=P_Login_In ID=P_Login_In>Login <INPUT TYPE=TEXT NAME=P_Pswd_