ExtractValue, extracted, xmlsequence

Could someone explain what extractvalue, xmlsequence and excerpt in the following query:
select
   extractvalue(value(a),'Notebook/@Brand') As Brand
  ,extractvalue(value(a),'Notebook/@Model') As Model
from prod_xml_tab b,
table( xmlsequence( extract( demo_field,'Product/Notebook' ) ) ) a
where demo_field is not null;
I went through documentation and still don't get it and need some basic step by step explanations. for example, what actually GETS back for the first and second rows?
the code in the table and the data is the following:
create table prod_xml_tab (demo_field xmltype);

insert into prod_xml_tab values('
  <Product type="Laptop">
              <Notebook Brand="HP" Model="Pavilion dv6-3132TX Notebook">
                          <Harddisk>640 GB</Harddisk>
                          <Processor>Intel Core i7</Processor>
                          <RAM>4 GB</RAM>
                          <Price>1189</Price>
                          <Display Type="LED" MonitorSize="15.6"/>
                          <Weight>4.14</Weight>
              </Notebook>
              <Notebook Brand="HP" Model="HP Pavilion dv6-3032TX Notebook">
                          <Harddisk>640 GB</Harddisk>
                          <Processor>Intel Core i7</Processor>
                          <RAM>6 GB</RAM>
                          <Price>1104</Price>
                          <Display Type="LED" MonitorSize="15.6"/>
                          <Weight>4.1</Weight>
              </Notebook>
              <Notebook Brand="HP" Model="Pavilion dv6-3079TX Notebook">
                          <Harddisk>500 GB</Harddisk>
                          <Processor>Intel Core i7</Processor>
                          <RAM>4 GB</RAM>
                          <Price>1099</Price>
                          <Display Type="LED" MonitorSize="15.6"/>
                          <Weight>4.14</Weight>
              </Notebook>
</Product>');

insert into prod_xml_tab values('
<Product>
              <Notebook Brand="Toshiba" Model="Satellite A660/07R 3D Notebook">
                          <Harddisk>640 GB</Harddisk>
                          <Processor>Intel Core i7</Processor>
                          <RAM>4 GB</RAM>
                          <Price>1444</Price>
                          <Display Type="LED" MonitorSize="15.6"/>
                          <Weight>4.88</Weight>
              </Notebook>
</Product>');

943276 wrote:
for example, if the first row not contained that single product/Notebook (as the second row) there is need to use TABLE (XMLSEQUENCE...), right? Only extractvalue (demo_field, "Product/Notebook/@Brand") would suffice, right? xmlsequence is necessary because the first line has several entrances laptop and all these multiple information is always returned as a bunch of items for laptop (knots?) instead of relational lines, is that correct? then xmlsequence comes into play in order to convert every book of this bunch of laptops in topics separated more later converted into relational lines by SCOREBOARD operator. is it more correct?

Thank you

Yep, that sounds about right.

With XMLTABLE, it would be something like this...

SQL> ed
Wrote file afiedt.buf

  1  select x.*
  2  from   prod_xml_tab
  3        ,xmltable('/Product/Notebook'
  4                  passing prod_xml_tab.demo_field
  5                  columns Brand        varchar2(10) path './@Brand'
  6                         ,Model        varchar2(30) path './@Model'
  7                         ,Harddisk     varchar2(10) path './Harddisk'
  8                         ,Processor    varchar2(15) path './Processor'
  9                         ,RAM          varchar2(10) path './RAM'
 10                         ,Price        number       path './Price'
 11                         ,Display_Type varchar2(5)  path './Display/@Type'
 12                         ,Display_Size varchar2(5)  path './Display/@MonitorSize'
 13                         ,Weight       number       path './Weight'
 14*                ) x
SQL> /

BRAND      MODEL                          HARDDISK   PROCESSOR       RAM             PRICE DISPL DISPL     WEIGHT
---------- ------------------------------ ---------- --------------- ---------- ---------- ----- ----- ----------
HP         Pavilion dv6-3132TX Notebook   640 GB     Intel Core i7   4 GB             1189 LED   15.6        4.14
HP         HP Pavilion dv6-3032TX Noteboo 640 GB     Intel Core i7   6 GB             1104 LED   15.6         4.1
HP         Pavilion dv6-3079TX Notebook   500 GB     Intel Core i7   4 GB             1099 LED   15.6        4.14
Toshiba    Satellite A660/07R 3D Notebook 640 GB     Intel Core i7   4 GB             1444 LED   15.6        4.88

Tags: Database

Similar Questions

  • issue of extract XMLType column

    my xml looks like one below, I am able to get the value of @emp-type using as described below, but not able to get @depName

    declare

    xmlDoc xmltype: = XMLTYPE. CREATEXML ("<?") XML version = "1.0" encoding ="UTF - 8"? >

    < comp: emp - def xmlns:comp = "some.namespace.uri" >

    < comp: def >

    < comp: emp-spec type emp = 'Manager' >

    < comp: spec xsi: Nil = "true" xmlns:xsi="some.namespace.uri"/ >

    < / model: emp-spec >

    < comp: emp-att-spec >

    a model of < comp: cond > < / model: cond >

    < comp: emp - det depName 'BUY' = age rank = "8" = "" / >

    < / model: emp-att-spec >

    < / model: def >

    (< / model: emp - def > ');

    RES varchar2 (300);

    Start

    ("Select extractvalue (xmldoc,'/comp:emp-def/comp:def/comp:emp-spec/comp:emp-att-spec/comp:cond/comp:emp-det/ @depName xmlns:comp ="some.namespace.uri"," "")

    in res

    Double;

    dbms_output.put_line('res...');

    dbms_output.put_line (res);

    end;

    ExtractValue (and xmlsequence) are deprecated XML features.

    To retrieve XML using SQLX data use XMLTABLE or XMLQUERY with XQuery expressions, as...

    SQL > ed
    A written file afiedt.buf

    1 with t as (select XMLTYPE ('))
    2
    3
    4
    5
    6

    7
    8 dummy
    9
    10

    11

    12
    ') in the XML of the double)
    13-
    14. end of test data
    15-
    16. Select x.*
    17 t
    18, xmltable (xmlnamespaces (' ' a few .uri .namespace ' like 'comp'),)
    19 ' computer: emp - def / model: def'
    20 passage t.xml
    path of 21 columns emp_type varchar2 (10) '. / comp:emp-spec/@emp-type'
    22 road of varchar2 (10) cond '. / model: emp-att-spec / model: cond'
    23 road of varchar2 (10) of depName '. / comp:emp-att-spec/comp:emp-det/@depName'
    24, path number rank '. / comp:emp-att-spec/comp:emp-det/@grade'
    25 road number age '. / comp:emp-att-spec/comp:emp-det/@age'
    26*                ) x
    SQL > /.

    EMP_TYPE COND. DEPNAME AGE GRADE
    ---------- ---------- ---------- ---------- ----------
    dummy Manager PURCHASE 8

    Note: I assume this model: def is the repeating group in this example.  If that contains other repeating groups while he would need other XMLTABLE expressions with a passerby content repetition across groups to effectively create a Cartesian results product.

  • Analysis using the extractvalue XML method

    Hello
    In the XML message I want to extract values in the brochure below. That is to say john and peter

    Select EXTRACTvalue (xmltype ("<?")) XML version = "1.0" encoding ="utf - 8"? >
    < startempdetail >
    < empDetails >
    < empDetail >
    John < name > < / name >
    < / empDetail >
    < empDetail >
    Peter < name > < / name >
    < / empDetail >
    < / empDetails >
    ((< / startempdetail > '), ' / startempdetail/empDetails/empDetail/name ")
    Double;

    its not work if only john. Can someone help me solve this problem?

    Thank you!

    ExtractValue returnin only acronym row.

    Try this please

    SELECT
    extractvalue
    (EXTRACT(xmltype('
    
    
    
    john
    
    
    peter
    
    
    '), '/startempdetail/empDetails/empDetail/name'),'/name[position()='||level||']')
    from dual connect by level<=2;
    
  • Extract using XPath

    Hello

    I have following XMLs in a column called XML_CLOB
    < a: root >
    < a: resources >
    < a: bicycle >
    < a: bikenum > 456 < / a: bikenum >
    < / a: bicycle >
    < / a: resources >
    < a: resources >
    < a: car >
    < a: carnum > 123 < / a: carnum >
    < / a: car >
    < / a: resources >
    < / a: root >

    < b:root >
    < b:resource >
    < b:car >
    < b:carnum > 789 < / b:carnum >
    < / b:car >
    < / b:resource >
    < / b:root >

    Now, I want to extract the carnum so my request is as shown below.

    Select extractValue (XML_CLOB, ' //*[local-name()="resource"]/*[local-name()="car"]/*[local-name () = "carnum"]')
    where existsnode (XML_CLOB, ' //*[local-name()="resource"]/*[local-name()="car"]/*[local-name () = "carnum"]') = 1;


    It gives me an error saying that extractvalue can extract only a single node. The XPath is clearly refers to a node in the XML file.

    I think that this is caused by two nodes of resources in the first XML document, but xpath should not be completely evaluated to detect duplicate nodes?

    Thank you and best regards,
    A

    Still no version number? It is important concerning XMLDB features...

    Prophet wrote:
    I want to go get the first occurrence of each XML carnum, but this request is to launch the previous error that I posted.

    It's not "pretty", but you can try:

    select extractvalue(
            extract(xml_clob, '//*[local-name()="carnum"]')
            , '*[1]'
           )
    from t
    where existsnode(xml_clob, '//*[local-name()="resource"]/*[local-name()="car"]/*[local-name()="carnum"]') = 1;
    

    Or, 10g and upward:

    select xmlquery(
     'for $i at $pos in //*[local-name()="carnum"]/text()
      where $pos = 1
      return $i'
     passing t.xml_clob
     returning content
    ).getStringVal()
    from t
    ;
    
  • XML file too large or too large XML element

    I try to import an xml file into the repository and have it shred in the object-relational tables. I signed up a diagram and it created types, triggers and object-relational xml_tables. The complete xml file is > 80 MB. XDB created all fields VARCHAR2 (4000).

    error code when you import the complete XML file. That's what I need to fix in the end.
    DECLARE
      res BOOLEAN;
    BEGIN
      res := DBMS_XDB.createResource('/home/pharma/drugbank.xml', 
                    bfilename('XMLPHARMA', 'drugbank.xml'),
                    nls_charset_id('AL32UTF8'));
    END;
    /
    COMMIT;
    
    XML file encounters errors on the import.
    An error was encountered performing the requested operation
    ORA-30951: Element or attribute at Xpath references exceeds maximum length
    ORA-06512 at "XDB.DBMS_XDB", line 315
    ORA-06512 at line 4
    30951.00000 - "Element or attribute at Xpath %x exceeds maximum length"
    *Cause: An attempt was made to insert a node of length exceeding the maximum length (specified by the maxLength facet) into an XML document.
    *Action: Do not attempt to add a node exceeding the maximum length to XML documents.
    Vendor code 30951Error at Line:18
    I guess that some fields have lengths > 4000 max. I intend to annotate the schema with SQLType = 'CLOB', but there are fields to change. I could copy the xml file and reduce this xml file to a record of any in the tables. My plan was to write a review on the bfile to get the lengths of some fields, annotate the .xsd with CLOB when needed and then import it again. To do this, I have a 1 imported in a table and as a bfile type recording file.

    Here is my code selection length in a generated object-relational table as a single folder.
    CREATE OR REPLACE VIEW pharma.drugs_vw AS
    SELECT d.*
    FROM drugs, XMLTABLE
      ('/drugs' PASSING OBJECT_VALUE COLUMNS
        drugbank_id        VARCHAR2(20)   PATH 'drug/drugbank-id',
        name               VARCHAR2(50)   PATH 'drug/name',
        description        VARCHAR2(4000) PATH 'drug/description'    
      ) d
    /
    
    select max(length(drugbank_id)) as dbidlen,
          max(length(name)) as nmlen,
          max(length(description)) as desclen
    from drugs_vw;
    
            DBIDLEN           NMLEN         DESCLEN
    --------------- --------------- ---------------
                  7               9             229
    
    1 row selected.
    Here's the code for the bfile. Same results, but using deprecated functions. I read the white paper, Oracle XML DB: best practices for optimal performance of queries XML. It is said that the function extract(), extractvalue(), Table (XMLSequence ()) and XMLType() are deprecated in 11 GR 2.
    -- Note extractvalue is deprecated in 11gr2 replaced by W3C standard
    --                                          XMLCast(XMLQuery())
    -- TABLE(XMLSequence) is replaced by XMLTable
    -- XMLType() is replaced by XMLParse()
    SELECT max(length(extractvalue(column_value, '/drug/drugbank-id'))) dbidlen,
           max(length(extractvalue(column_value, '/drug/name'))) nmlen,
           max(length(extractvalue(column_value, '/drug/description'))) desclen
    FROM TABLE(XMLSequence(XMLTYPE(bfilename('XMLPHARMA',
    'db00001.xml'),nls_charset_id('AL32UTF8')).extract('/drugs/drug'))) d
    WHERE ROWNUM <= 5;
    
            DBIDLEN           NMLEN         DESCLEN
    --------------- --------------- ---------------
                  7               9             229
    Is this better code to get the maximum length of a bfile type xml fields? Here's what I have so far. It works on a simple drugbank id.
    SELECT max(length(drugbank_id)) AS dbidlen,
           max(length(name)) AS nmlen,
           max(length(description)) AS desclen
    FROM (XMLTABLE('*'
                    PASSING (XMLType(bfilename('XMLPHARMA', 'db00001.xml'),nls_charset_id('AL32UTF8')))
                    COLUMNS
        drugbank_id        VARCHAR2(20)   PATH 'drug/drugbank-id',
        name               VARCHAR2(50)   PATH 'drug/name',
        description        VARCHAR2(4000) PATH 'drug/description'
      )
    );
    I try to run it on the full file and get this error
    Error report:
    SQL Error: ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00007: unexpected end-of-file encountered
    31011. 00000 -  "XML parsing failed"
    *Cause:    XML parser returned an error while trying to parse the document.
    *Action:   Check if the document to be parsed is valid.
    The code to create patterns and object-relational tables. It worked well.
    set serveroutput on
    -- Create resource file for schema
    DECLARE
      res BOOLEAN;
    BEGIN
      res := DBMS_XDB.createResource('/home/pharma/drugbank.xsd', 
                    bfilename('XMLPHARMA', 'drugbank.xsd'),
                    nls_charset_id('AL32UTF8'));
      COMMIT;
    END;
    /
    
    -- optional debugging of create types and tables if you want a trace
    ALTER SESSION SET EVENTS = '31098 TRACE NAME CONTEXT FOREVER';
    
    BEGIN
      DBMS_XMLSCHEMA.registerSchema(
          SCHEMAURL => 'http://localhost:8080/home/pharma/drugbank.xsd',
          SCHEMADOC => bfilename('XMLPHARMA', 'drugbank.xsd'),
          CSID      => nls_charset_id('AL32UTF8'),
          LOCAL     => TRUE,
          GENTYPES  => TRUE,
          GENTABLES => TRUE,
          OWNER     => 'PHARMA');
      COMMIT;
    END;
    /
    SQL> select * from v$version;
    BANNER
    ---------------------------------------------------------------
    Oracle Database 11g Release 11.2.0.2.0 - Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE    11.2.0.2.0      Production
    TNS for 32-bit Windows: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    Follows the xml schema. Sorry for the length, but I think I might break something if I he snipped.
    <?xml version="1.0" encoding="UTF-8"?>
         <xs:schema  
         xmlns:xs="http://www.w3.org/2001/XMLSchema"  
         xmlns:xdb="http://xmlns.oracle.com/xdb"
         >
    
         <!-- General type definitions -->
         <xs:simpleType name="DecimalOrEmptyType">
              <xs:union memberTypes="xs:decimal EmptyStringType"/>
         </xs:simpleType>
         <xs:simpleType name="EmptyStringType">
              <xs:restriction base="xs:string">
                   <xs:enumeration value=""/>
              </xs:restriction>
         </xs:simpleType>
    
         <!-- Element Definitions -->
         <!-- Drug secondary accession number definition begins -->
         <xs:element name="secondary-accession-numbers" xdb:defaultTable="SECONDARY_ACCESSION_NUMBERS">
              <xs:complexType>
                   <xs:sequence maxOccurs="unbounded" minOccurs="0">
                        <xs:element name="secondary-accession-number" type="xs:string"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug secondary accession number definition ends -->
         <!-- Drug groups definition begins -->
         <xs:element name="groups" xdb:defaultTable="GROUPS">
              <xs:complexType>
                   <xs:sequence maxOccurs="unbounded" minOccurs="0">
                        <xs:element name="group">
                             <xs:simpleType>
                                  <xs:restriction base="xs:string">
                                       <xs:enumeration value="approved"/>
                                       <xs:enumeration value="illicit"/>
                                       <xs:enumeration value="experimental"/>
                                       <xs:enumeration value="withdrawn"/>
                                       <xs:enumeration value="nutraceutical"/>
                                  </xs:restriction>
                             </xs:simpleType>
                        </xs:element>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug groups definition ends -->
         <!-- Drug taxonomy definition begins -->
         <xs:element name="substructure">
              <xs:complexType>
                   <xs:simpleContent>
                        <xs:extension base="xs:string">
                             <xs:attribute name="class" type="xs:string" use="required"/>
                        </xs:extension>
                   </xs:simpleContent>
              </xs:complexType>
         </xs:element>
         <xs:element name="substructures" xdb:defaultTable="SUBSTRUCTURES">
              <xs:complexType>
                   <xs:sequence maxOccurs="unbounded" minOccurs="0">
                        <xs:element ref="substructure"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="taxonomy" xdb:defaultTable="TAXONOMY">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="kingdom" type="xs:string"/>
                        <xs:element ref="substructures"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug taxonomy definition ends -->
         <!-- Drug brands definition begins -->
         <xs:element name="brands" xdb:defaultTable="BRANDS">
              <xs:complexType>
                   <xs:sequence maxOccurs="unbounded" minOccurs="0">
                        <xs:element name="brand" type="xs:string"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug brands definition ends -->
         <!-- Drug mixtures definition begins -->
         <xs:element name="mixture">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="name" type="xs:string"/>
                        <xs:element name="ingredients" type="xs:string"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="mixtures" xdb:defaultTable="MIXTURES">
              <xs:complexType>
                   <xs:sequence maxOccurs="unbounded" minOccurs="0">
                        <xs:element ref="mixture"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug mixtures definition ends -->
         <!-- Drug packagers definition begins -->
         <xs:element name="packager">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="name" type="xs:string"/>
                        <xs:element name="url" type="xs:string"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="packagers" xdb:defaultTable="PACKAGERS">
              <xs:complexType>
                   <xs:sequence maxOccurs="unbounded" minOccurs="0">
                        <xs:element ref="packager"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug packagers definition ends -->
         <!-- Drug manufacturers definition begins -->
         <xs:element name="manufacturer">
              <xs:complexType>
                   <xs:simpleContent>
                        <xs:extension base="xs:string">
                             <xs:attribute name="generic" type="xs:string" use="required"/>
                        </xs:extension>
                   </xs:simpleContent>
              </xs:complexType>
         </xs:element>
         <xs:element name="manufacturers" xdb:defaultTable="MANUFACTURERS">
              <xs:complexType>
                   <xs:sequence maxOccurs="unbounded" minOccurs="0">
                        <xs:element ref="manufacturer"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug manufactures definition ends -->
         <!-- Drug pricing definition begins -->
         <xs:element name="cost">
              <xs:complexType>
                   <xs:simpleContent>
                        <xs:extension base="xs:string">
                             <xs:attribute name="currency" type="xs:string" use="required"/>
                        </xs:extension>
                   </xs:simpleContent>
              </xs:complexType>
         </xs:element>
         <xs:element name="price">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="description" type="xs:string"/>
                        <xs:element ref="cost"/>
                        <xs:element name="unit" type="xs:string"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="prices" xdb:defaultTable="PRICES">
              <xs:complexType>
                   <xs:sequence maxOccurs="unbounded" minOccurs="0">
                        <xs:element ref="price"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug pricing definition ends -->
         <!-- Drug categories definition begins -->
         <xs:element name="categories" xdb:defaultTable="CATEGORIES">
              <xs:complexType>
                   <xs:sequence maxOccurs="unbounded" minOccurs="0">
                        <xs:element name="category" type="xs:string"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug categories definition ends -->
         <!-- Drug affected orgainsms definition begins -->
         <xs:element name="affected-organisms" xdb:defaultTable="AFFECTED_ORGANISMS">
              <xs:complexType>
                   <xs:sequence maxOccurs="unbounded" minOccurs="0">
                        <xs:element name="affected-organism" type="xs:string"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug affected organisms definition ends -->
         <!-- Drug dosage definition begins -->
         <xs:element name="dosage">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="form" type="xs:string"/>
                        <xs:element name="route" type="xs:string"/>
                        <xs:element name="strength" type="xs:string"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="dosages" xdb:defaultTable="DOSAGES">
              <xs:complexType>
                   <xs:sequence maxOccurs="unbounded" minOccurs="0">
                        <xs:element ref="dosage"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug dosages definition ends -->
         <!-- Drug ATC codes definition begins -->
         <xs:element name="atc-codes" xdb:defaultTable="ATC_CODES">
              <xs:complexType>
                   <xs:sequence maxOccurs="unbounded" minOccurs="0">
                        <xs:element name="atc-code" type="xs:string"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug ATC codes definition ends -->
         <!-- Drug AHFS codes definition begins -->
         <xs:element name="ahfs-codes" xdb:defaultTable="AHFS_CODES">
              <xs:complexType>
                   <xs:sequence maxOccurs="unbounded" minOccurs="0">
                        <xs:element name="ahfs-code" type="xs:string"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug AHFS codes definition ends -->
         <!-- Drug Patent definition begins -->
         <xs:element name="patent">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="number" type="xs:string"/>
                        <xs:element name="country" type="xs:string"/>
                        <xs:element name="approved" type="xs:string"/>
                        <xs:element name="expires" type="xs:string"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="patents" xdb:defaultTable="PATENTS">
              <xs:complexType>
                   <xs:sequence maxOccurs="unbounded" minOccurs="0">
                        <xs:element ref="patent"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug patent definition ends -->
         <!-- Drug food interactions definition begins -->
         <xs:element name="food-interactions" xdb:defaultTable="FOOD_INTERACTIONS">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="food-interaction" type="xs:string" maxOccurs="unbounded" minOccurs="0"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug food interactions definition ends -->
         <!-- Drug drug interactions definition begins -->
         <xs:element name="drug-interaction">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="drug" type="xs:integer"/>
                        <xs:element name="description" type="xs:string"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="drug-interactions" xdb:defaultTable="DRUG_INTERACTIONS">
              <xs:complexType>
                   <xs:sequence maxOccurs="unbounded" minOccurs="0">
                        <xs:element ref="drug-interaction"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug drug interactions definition ends -->
         <!-- Drug protein sequences (biotech) definition begins -->
         <xs:element name="protein-sequences" xdb:defaultTable="PROTEIN_SEQUENCES">
              <xs:complexType>
                   <xs:sequence maxOccurs="unbounded" minOccurs="0">
                        <xs:element name="protein-sequence" type="SequenceType"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug protein sequences (biotech) definition ends-->
         <!-- Drug external links definition begins -->
         <xs:element name="external-link">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="resource" type="xs:string"/>
                        <xs:element name="url" type="xs:string"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="external-links" xdb:defaultTable="EXTERNAL_LINKS">
              <xs:complexType>
                   <xs:sequence maxOccurs="unbounded" minOccurs="0">
                        <xs:element ref="external-link"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug external links definition ends -->
         <!-- Drug targets definition begins -->
         <xs:element name="targets" xdb:defaultTable="TARGETS">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="target" type="TargetBondType" minOccurs="0" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug targets definition ends -->
         <!-- Drug enzymes definition begins -->
         <xs:element name="enzymes" xdb:defaultTable="ENZYMES">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="enzyme" type="BondType" minOccurs="0" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug enzmes definition ends -->
         <!-- Drug transporters definition begins -->
         <xs:element name="transporters" xdb:defaultTable="TRANSPORTERS">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="transporter" type="BondType" minOccurs="0" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug transporters definition ends -->
         <!-- Drug carriers definition begins -->
         <xs:element name="carriers" xdb:defaultTable="CARRIERS">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="carrier" type="BondType" minOccurs="0" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Drug carriers definition ends -->
         <!-- Partner  Pfams definition begins -->
         <xs:element name="pfam">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="identifier" type="xs:string"/>
                        <xs:element name="name" type="xs:string"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="pfams" xdb:defaultTable="PFAMS">
              <xs:complexType>
                   <xs:sequence minOccurs="0" maxOccurs="unbounded">
                        <xs:element ref="pfam"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Partner  Pfams definition end -->
         <!-- Partner  GO Classification definition begins -->
         <xs:element name="go-classifier">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="category" type="xs:string"/>
                        <xs:element name="description" type="xs:string"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="go-classifiers" xdb:defaultTable="GO_CLASSIFIERS">
              <xs:complexType>
                   <xs:sequence minOccurs="0" maxOccurs="unbounded">
                        <xs:element ref="go-classifier"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <!-- Partner  GO Classification definition ends -->
         <!-- Partner Essentiality definition begins -->
         <xs:element name="essentiality">
              <xs:simpleType>
                   <xs:restriction base="xs:string">
                        <xs:enumeration value="Essential"/>
                        <xs:enumeration value="Non-Essential"/>
                   </xs:restriction>
              </xs:simpleType>
         </xs:element>
         <!-- Partner Essentiality definition ends -->
         
         <!-- Complex Type Definitions -->
         <xs:complexType name="SequenceType">
              <xs:sequence>
                   <xs:element name="header" type="xs:string"/>
                   <xs:element name="chain" type="xs:string"/>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="PropertyType">
              <xs:sequence>
                   <xs:element name="kind">
                        <xs:simpleType>
                             <xs:restriction base="xs:string">
                                  <xs:enumeration value="logP"/>
                                  <xs:enumeration value="logS"/>
                                  <xs:enumeration value="logP/hydrophobicity"/>
                                  <xs:enumeration value="Water Solubility"/>
                                  <xs:enumeration value="caco2 Permeability"/>
                                  <xs:enumeration value="pKa"/>
                                  <xs:enumeration value="IUPAC Name"/>
                                  <xs:enumeration value="Molecular Weight"/>
                                  <xs:enumeration value="Monoisotopic Weight"/>
                                  <xs:enumeration value="SMILES"/>
                                  <xs:enumeration value="Molecular Formula"/>
                                  <xs:enumeration value="InChI"/>
                                  <xs:enumeration value="InChIKey"/>
                             </xs:restriction>
                        </xs:simpleType>
                   </xs:element>
                   <xs:element name="value" type="xs:string"/>
                   <xs:element name="source">
                        <xs:simpleType>
                             <xs:restriction base="xs:string">
                                  <xs:enumeration value="JChem"/>
                                  <xs:enumeration value="ALOGPS"/>
                                  <xs:enumeration value=""/>
                             </xs:restriction>
                        </xs:simpleType>
                   </xs:element>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="PropertiesType">
              <xs:sequence>
                   <xs:element name="property" type="PropertyType" minOccurs="0" maxOccurs="unbounded"/>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="SynonymsType">
              <xs:sequence maxOccurs="unbounded" minOccurs="0">
                   <xs:element name="synonym" type="xs:string"/>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="IdentifiersType">
              <xs:sequence maxOccurs="unbounded" minOccurs="0">
                   <xs:element name="external-identifier">
                        <xs:complexType>
                             <xs:sequence>
                                  <xs:element name="resource" type="xs:string"/>
                                  <xs:element name="identifier" type="xs:string"/>
                             </xs:sequence>
                        </xs:complexType>
                   </xs:element>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="BondActionsType">
              <xs:sequence maxOccurs="unbounded" minOccurs="0">
                   <xs:element name="action" type="xs:string"/>
              </xs:sequence>
         </xs:complexType>
         <xs:complexType name="BondType">
              <xs:sequence>
                   <xs:element name="actions" type="BondActionsType"/>
                   <xs:element name="references" type="xs:string"/>
              </xs:sequence>
              <xs:attribute name="position" type="xs:integer" use="optional"/>
              <xs:attribute name="partner" type="xs:integer"/>
         </xs:complexType>
         <xs:complexType name="TargetBondType">
              <xs:complexContent>
                   <xs:extension base="BondType">
                        <xs:sequence>
                             <xs:element name="known-action">
                                  <xs:simpleType>
                                       <xs:restriction base="xs:string">
                                            <xs:enumeration value="yes"/>
                                            <xs:enumeration value="no"/>
                                            <xs:enumeration value="unknown"/>
                                       </xs:restriction>
                                  </xs:simpleType>
                             </xs:element>
                        </xs:sequence>
                   </xs:extension>
              </xs:complexContent>
         </xs:complexType>
         
         <xs:complexType name="PartnerType">
              <xs:sequence>
                   <xs:element name="name" type="xs:string"/>
                   <xs:element name="general-function" type="xs:string"/>
                   <xs:element name="specific-function" type="xs:string"/>
                   <xs:element name="gene-name" type="xs:string"/>
                   <xs:element name="locus" type="xs:string"/>
                   <xs:element name="reaction" type="xs:string"/>
                   <xs:element name="signals" type="xs:string"/>
                   <xs:element name="cellular-location" type="xs:string"/>
                   <xs:element name="transmembrane-regions" type="xs:string"/>
                   <xs:element name="theoretical-pi" type="DecimalOrEmptyType"/>
                   <xs:element name="molecular-weight" type="DecimalOrEmptyType"/>
                   <xs:element name="chromosome" type="xs:string"/>
                   <xs:element ref="essentiality"/>
                   <xs:element name="references" type="xs:string"/>
                   <xs:element name="external-identifiers" type="IdentifiersType"/>
                   <xs:element name="synonyms" type="SynonymsType"/>
                   <xs:element name="protein-sequence" type="SequenceType" minOccurs="0"/>
                   <xs:element name="gene-sequence" type="SequenceType" minOccurs="0"/>
                   <xs:element ref="pfams"/>
                   <xs:element ref="go-classifiers"/>
              </xs:sequence>
              <xs:attribute name="id" type="xs:integer" use="required"/>
         </xs:complexType>
         <xs:complexType name="DrugType">
              <xs:sequence>
                   <xs:element name="drugbank-id" type="xs:string"/>
                   <xs:element name="name" type="xs:string"/>
                   <xs:element name="description" type="xs:string"/>
                   <xs:element name="cas-number" type="xs:string"/>
                   <xs:element name="general-references" type="xs:string"/>
                   <xs:element name="synthesis-reference" type="xs:string"/>
                   <xs:element name="indication" type="xs:string"/>
                   <xs:element name="pharmacology" type="xs:string"/>
                   <xs:element name="mechanism-of-action" type="xs:string"/>
                   <xs:element name="toxicity" type="xs:string"/>
                   <xs:element name="biotransformation" type="xs:string"/>
                   <xs:element name="absorption" type="xs:string"/>
                   <xs:element name="half-life" type="xs:string"/>
                   <xs:element name="protein-binding" type="xs:string"/>
                   <xs:element name="route-of-elimination" type="xs:string"/>
                   <xs:element name="volume-of-distribution" type="xs:string"/>
                   <xs:element name="clearance" type="xs:string"/>
                   <xs:element ref="secondary-accession-numbers"/>
                   <xs:element ref="groups"/>
                   <xs:element ref="taxonomy"/>
                   <xs:element name="synonyms" type="SynonymsType"/>
                   <xs:element ref="brands"/>
                   <xs:element ref="mixtures"/>
                   <xs:element ref="packagers"/>
                   <xs:element ref="manufacturers"/>
                   <xs:element ref="prices"/>
                   <xs:element ref="categories"/>
                   <xs:element ref="affected-organisms"/>
                   <xs:element ref="dosages"/>
                   <xs:element ref="atc-codes"/>
                   <xs:element ref="ahfs-codes"/>
                   <xs:element ref="patents"/>
                   <xs:element ref="food-interactions"/>
                   <xs:element ref="drug-interactions"/>
                   <xs:element ref="protein-sequences" minOccurs="0"/><!-- Only present for biotech drugs -->
                   <xs:element name="calculated-properties" type="PropertiesType" minOccurs="0"/><!-- Only present for small molecule drugs -->
                   <xs:element name="experimental-properties" type="PropertiesType"/>
                   <xs:element name="external-identifiers" type="IdentifiersType"/>
                   <xs:element ref="external-links"/>
                   <xs:element ref="targets"/>
                   <xs:element ref="enzymes"/>
                   <xs:element ref="transporters"/>
                   <xs:element ref="carriers"/>
              </xs:sequence>
              <xs:attribute name="type" use="required">
                   <xs:simpleType>
                        <xs:restriction base="xs:string">
                             <xs:enumeration value="small molecule"/>
                             <xs:enumeration value="biotech"/>
                        </xs:restriction>
                   </xs:simpleType>
              </xs:attribute>
              <xs:attribute name="updated" type="xs:string" use="required"/>
              <xs:attribute name="created" type="xs:string" use="required"/>
              <xs:attribute name="version" type="xs:decimal" use="required"/>
         </xs:complexType>
         
         <xs:element name="drugs"  xdb:defaultTable="DRUGS">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="drug" type="DrugType" minOccurs="0" maxOccurs="unbounded" />
                        <xs:element name="partners">
                             <xs:complexType>
                                  <xs:sequence>
                                       <xs:element name="partner" type="PartnerType" minOccurs="0" maxOccurs="unbounded" />
                                  </xs:sequence>
                             </xs:complexType>
                        </xs:element>
                   </xs:sequence>
              </xs:complexType>
         
              <xs:keyref name="targetPartnerIdKeyRef" refer="partnerIdKey">
                   <xs:selector xpath="drug/targets/*"/>
                   <xs:field xpath="@partner"/>
              </xs:keyref>
              <xs:keyref name="enzymePartnerIdKeyRef" refer="partnerIdKey">
                   <xs:selector xpath="drug/enzymes/*"/>
                   <xs:field xpath="@partner"/>
              </xs:keyref>
              <xs:keyref name="transporterPartnerIdKeyRef" refer="partnerIdKey">
                   <xs:selector xpath="drug/transporters/*"/>
                   <xs:field xpath="@partner"/>
              </xs:keyref>
              <xs:keyref name="carrierPartnerIdKeyRef" refer="partnerIdKey">
                   <xs:selector xpath="drug/carriers/*"/>
                   <xs:field xpath="@partner"/>
              </xs:keyref>
              <xs:key name="partnerIdKey">
                   <xs:selector xpath=".//partner"/>
                   <xs:field xpath="@id"/>
              </xs:key>
         </xs:element>     
    </xs:schema>
    Optimization white paper request
    http://www.Oracle.com/technetwork/database/features/xmldb/xmlqueryoptimize11gr2-168036.PDF

    Well Yes... You need not put GENTABLES-online TRUE when recording object relational. There are no structures in XML schema that require tables on online storage...

    SQL> DECLARE
      2    V_XMLSCHEMA XMLTYPE := xmltype(bfilename('&USERNAME', 'drugbank.xsd'),nls_charset_id('AL32UTF8'));
      3  BEGIN
      4          DBMS_XMLSCHEMA_ANNOTATE.disableDefaultTableCreation(V_XMLSCHEMA);
      5          DBMS_XMLSCHEMA_ANNOTATE.disableMaintainDOM(V_XMLSCHEMA);
      6          DBMS_XMLSCHEMA_ANNOTATE.setSQLType(V_XMLSCHEMA,DBMS_XDB_CONSTANTS.XSD_COMPLEX_TYPE,'BondType',DBMS_XDB_CONSTANTS.XSD_ELEMENT,'references','CLOB',TRUE);
      7          DBMS_XMLSCHEMA_ANNOTATE.setSQLType(V_XMLSCHEMA,DBMS_XDB_CONSTANTS.XSD_COMPLEX_TYPE,'PartnerType',DBMS_XDB_CONSTANTS.XSD_ELEMENT,'references','CLOB',TRUE);
      8          DBMS_XMLSCHEMA_ANNOTATE.setSQLType(V_XMLSCHEMA,DBMS_XDB_CONSTANTS.XSD_COMPLEX_TYPE,'DrugType',DBMS_XDB_CONSTANTS.XSD_ELEMENT,'general-references','CLOB',TRUE);
      9          DBMS_XMLSCHEMA_ANNOTATE.setSQLType(V_XMLSCHEMA,DBMS_XDB_CONSTANTS.XSD_COMPLEX_TYPE,'SequenceType',DBMS_XDB_CONSTANTS.XSD_ELEMENT,'chain','CLOB',TRUE);
     10    DBMS_XMLSCHEMA.registerSchema(
     11        SCHEMAURL => :SCHEMAURL,
     12        SCHEMADOC => V_XMLSCHEMA,
     13        LOCAL     => TRUE,
     14        GENTYPES  => TRUE,
     15        GENTABLES => TRUE);
     16  END;
     17  /
    old   2:   V_XMLSCHEMA XMLTYPE := xmltype(bfilename('&USERNAME', 'drugbank.xsd'),nls_charset_id('AL32UTF8'));
    new   2:   V_XMLSCHEMA XMLTYPE := xmltype(bfilename('PHARMA', 'drugbank.xsd'),nls_charset_id('AL32UTF8'));
    
    PL/SQL procedure successfully completed.
    
    Elapsed: 00:00:01.65
    SQL> CREATE TABLE drugs_xmltype OF XMLTYPE
      2  XMLSCHEMA "http://lims.drugbank.ca/docs/drugbank.xsd"
      3  ELEMENT "drugs"
      4  /
    
    Table created.
    

    results in

    SQL*Plus: Release 11.2.0.3.0 Production on Fri Apr 29 16:14:00 2011
    
    Copyright (c) 1982, 2011, Oracle.  All rights reserved.
    
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    SQL> select table_name from user_xml_tables;
    
    TABLE_NAME
    ------------------------------
    DRUGS_XMLTYPE
    
    SQL> select count(*) from user_nested_tables;
    
      COUNT(*)
    ----------
            36
    
    SQL>
    
  • Create indexes for an XMLType column.

    Hello

    I have a table that has a column of XMLType, the XSD is saved in DB. The XML is something like -

    < primary >
    < sub1 >
    < child1_1 / >
    < child1_2 / >
    < child1_3 / >
    < / sub1 >
    < sub2 >
    < child2_1 / >
    < child2_2 / >
    < child2_3 / >
    < / sub2 >
    < sub3 >
    < child31_1 / >
    < child3_2 / >
    < child3_3 / >
    < / sub3 >
    < / elementary school >

    I want to create indexes for child nodes. I read THAT XML structure cannot have collection as index it should be singleton.
    So can someone tell me no work around to create indexes for these nodes, or whatever it is that I missed as follows.

    Thank you

    #1. Since you're on 11g stop using the syntax of depricated... (extractValue, table (xmlsequence))

    SQL> create table PURCHASEORDER_TAB
      2  (
      3    PID number(4),
      4    PURCHASEORDER XMLTYPE
      5  )
      6  xmltype column PURCHASEORDER
      7  store as OBJECT RELATIONAL
      8  XMLSCHEMA "http://localhost:80/publishedContent/SB-XML/xsd/2010/purchaseOrder.xsd" Element "PurchaseOrder"
      9  /
    
    Table created.
    
    SQL> select table_name, table_type_name
      2  from user_nested_tables where parent_table_name = 'PURCHASEORDER_TAB';
    
    TABLE_NAME                     TABLE_TYPE_NAME
    ------------------------------ ------------------------------
    SYS_NTdmDOdAAMQsuXdRy6lc0H/A== Action64442_COLL
    SYS_NT8EIzAbUOQFGN2u6hCXP39g== LineItem64443_COLL
    
    SQL> rename "SYS_NT8EIzAbUOQFGN2u6hCXP39g==" to LINEITEM_NT
      2  /
    
    Table renamed.
    
    SQL> create index QTY_INDEX on LINEITEM_NT ("Quantity");
    
    Index created.
    
    SQL> set autotrace on explain lines 250 pages 50 trimspool on
    SQL> --
    SQL> select t.pid, quantity
      2    from PURCHASEORDER_TAB t,
      3         XMLTABLE
      4         (
      5           '/PurchaseOrder/LineItems/LineItem'
      6           passing t.PURCHASEORDER
      7           columns
      8           QUANTITY number(4) path 'Quantity'
      9         )
     10   where QUANTITY = 3
     11  /
    
    no rows selected
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 1929272390
    
    --------------------------------------------------------------------------------------------------
    | Id  | Operation                    | Name              | Rows  | Bytes | Cost (%CPU)| Time     |
    --------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT             |                   |     1 |    46 |     3   (0)| 00:00:01 |
    |   1 |  NESTED LOOPS                |                   |       |       |            |          |
    |   2 |   NESTED LOOPS               |                   |     1 |    46 |     3   (0)| 00:00:01 |
    |*  3 |    TABLE ACCESS FULL         | LINEITEM_NT       |     1 |    23 |     2   (0)| 00:00:01 |
    |*  4 |    INDEX UNIQUE SCAN         | SYS_C00429284     |     1 |       |     0   (0)| 00:00:01 |
    |   5 |   TABLE ACCESS BY INDEX ROWID| PURCHASEORDER_TAB |     1 |    23 |     1   (0)| 00:00:01 |
    --------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       3 - filter(CAST(TO_NUMBER(TO_CHAR("Quantity")) AS number(4) )=3)
       4 - access("NESTED_TABLE_ID"="T"."SYS_NC0002900030$")
    
    Note
    -----
       - dynamic sampling used for this statement (level=2)
    
    SQL> select t.pid, quantity
      2    from PURCHASEORDER_TAB t,
      3         XMLTABLE
      4         (
      5           '/PurchaseOrder/LineItems/LineItem'
      6           passing t.PURCHASEORDER
      7           columns
      8           QUANTITY number(12,4) path 'Quantity'
      9         )
     10   where QUANTITY = 3
     11  /
    
    no rows selected
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 3093486066
    
    --------------------------------------------------------------------------------------------------
    | Id  | Operation                    | Name              | Rows  | Bytes | Cost (%CPU)| Time     |
    --------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT             |                   |     1 |    46 |     2   (0)| 00:00:01 |
    |   1 |  NESTED LOOPS                |                   |       |       |            |          |
    |   2 |   NESTED LOOPS               |                   |     1 |    46 |     2   (0)| 00:00:01 |
    |   3 |    TABLE ACCESS FULL         | PURCHASEORDER_TAB |     1 |    23 |     2   (0)| 00:00:01 |
    |*  4 |    INDEX RANGE SCAN          | QTY_INDEX         |     1 |       |     0   (0)| 00:00:01 |
    |*  5 |   TABLE ACCESS BY INDEX ROWID| LINEITEM_NT       |     1 |    23 |     0   (0)| 00:00:01 |
    --------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       4 - access("Quantity"=3)
       5 - filter("NESTED_TABLE_ID"="T"."SYS_NC0002900030$")
    
    Note
    -----
       - dynamic sampling used for this statement (level=2)
    
    SQL> select t.pid, quantity
      2    from PURCHASEORDER_TAB t,
      3         XMLTABLE
      4         (
      5           '/PurchaseOrder/LineItems/LineItem'
      6           passing t.PURCHASEORDER
      7           columns
      8           QUANTITY path 'Quantity'
      9         )
     10   where QUANTITY = 3
     11  /
    
    no rows selected
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 3093486066
    
    --------------------------------------------------------------------------------------------------
    | Id  | Operation                    | Name              | Rows  | Bytes | Cost (%CPU)| Time     |
    --------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT             |                   |     1 |    46 |     2   (0)| 00:00:01 |
    |   1 |  NESTED LOOPS                |                   |       |       |            |          |
    |   2 |   NESTED LOOPS               |                   |     1 |    46 |     2   (0)| 00:00:01 |
    |   3 |    TABLE ACCESS FULL         | PURCHASEORDER_TAB |     1 |    23 |     2   (0)| 00:00:01 |
    |*  4 |    INDEX RANGE SCAN          | QTY_INDEX         |     1 |       |     0   (0)| 00:00:01 |
    |*  5 |   TABLE ACCESS BY INDEX ROWID| LINEITEM_NT       |     1 |    23 |     0   (0)| 00:00:01 |
    --------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       4 - access("Quantity"=3)
       5 - filter("NESTED_TABLE_ID"="T"."SYS_NC0002900030$")
    
    Note
    -----
       - dynamic sampling used for this statement (level=2)
    
    SQL> SELECT t.pid, extractValue(Value(sta),'/LineItem/Quantity')
      2    FROM PURCHASEORDER_TAB t,
      3    table(xmlsequence(extract(t.purchaseOrder,'/PurchaseOrder/LineItems/LineItem'))) sta
      4    WHERE extractValue(Value(sta),'/LineItem/Quantity')= 3
      5  /
    
    no rows selected
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 3093486066
    
    --------------------------------------------------------------------------------------------------
    | Id  | Operation                    | Name              | Rows  | Bytes | Cost (%CPU)| Time     |
    --------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT             |                   |     1 |    46 |     2   (0)| 00:00:01 |
    |   1 |  NESTED LOOPS                |                   |       |       |            |          |
    |   2 |   NESTED LOOPS               |                   |     1 |    46 |     2   (0)| 00:00:01 |
    |   3 |    TABLE ACCESS FULL         | PURCHASEORDER_TAB |     1 |    23 |     2   (0)| 00:00:01 |
    |*  4 |    INDEX RANGE SCAN          | QTY_INDEX         |     1 |       |     0   (0)| 00:00:01 |
    |*  5 |   TABLE ACCESS BY INDEX ROWID| LINEITEM_NT       |     1 |    23 |     0   (0)| 00:00:01 |
    --------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       4 - access("Quantity"=3)
       5 - filter("NESTED_TABLE_ID"="T"."SYS_NC0002900030$")
    
    Note
    -----
       - dynamic sampling used for this statement (level=2)
    
    SQL>
    

    Note the first example XMLTable does not use the index because the data type of AMOUNT is given wrong...

  • Order items TABLE (XMLSEQUENCE (Extract (...)))

    Hello

    I inherited a piece of SQL, extract information from an XMLTYPE column and I have a problem with the order of the returned items.

    My XML looks like this:

    < recommendation > < row >... < / line > < row >... < / Line > etc. < / recommendation >

    This is a comment and is divided into several lines (a limitation of the source system).

    I want to read the contents of each line and save it in a VARCHAR2 field but I want to keep the original order of the < row > elements to have a message with a sense in the end, beside the text I want to store a "Line number" column

    To make this work, I got something like this:

    SELECT

    a.ID,

    Extract (value (Rec), 'Line') online.

    ROW_NUMBER() over (PARTITION BY a.id ORDER BY null) as line_number

    Loads of table_with_the_id_to_process,

    table_with_my_XML has,

    REC TABLE (XMLSEQUENCE (EXTRACT (a.xmltext, ' / / recommendation/Line ')))

    WHERE a.id = loads.id

    It worked fine with 2-3 rows during the tests, but when running on real data (250-300 lines with XML fields) "line_number" become a bit at random: always start at 1 and go up until the number of element < row >, the order is as randomly, so my comments doesn't have a logical sense if I retrieve ordered them to "line_number.

    Any idea on how to get the <>the position of number or something else to calculate my column "line_number?

    Maybe I missed in the doc and Google simply because using bad language of research, so I'm open to any suggestion or idea.

    Thank you

    Gianni,

    What is your version of the database?

    The construction of the TABLE/XMLSequence has been deprecated in 11.2 for the function XMLTABLE.

    XMLTABLE is available from version 10.2 and has a clause for ORDINALITE to generate the sequence of required integer.

    You can also rebuild the entire message in a single VARCHAR2 or CLOB (depending on the size) and get rid of these line numbers.

  • XDB. XMLIndex problem and table (XMLSEQUENCE (EXTRACT (xmltype, path))

    Hello
    I have a database of Oracle 11 g Release 11.1.0.6.0 - 64 bit Production With the Real Application Clusters option.

    I feel something strange with an XMLType column.
    I have a table configurator.t_vehicle_configuration (id_vehicle x_configuration NUMBER, XMLType).
    x_configuration is unstructured.

    I created an index on the field of xml in this way:

    CREATE INDEX idx_vehicle_configuration ON configurator.t_vehicle_configuration (x_configuration) INDEXTYPE IS XDB. XMLIndex;

    Then I have a package implementing a function that count nodes in the xml field and its return values

    This does not (return 0 instead of 1):
        SELECT count(*)
          INTO count_
          FROM configurator.v_vehicle_configuration vc,
               table(XMLSEQUENCE(EXTRACT(vc.x_configuration, '/vehicleconf/GeoFence/spaceTarget[@id="'||in_id_space_target||'"]/user[@id="'||in_id_user||'"]/alarmwhen'))) p
         WHERE vc.id_vehicle = in_id_vehicle;
        
        RETURN count_;
    This mode of operation (return 1):
        str_ := '/vehicleconf/GeoFence/spaceTarget[@id="'||in_id_space_target||'"]/user[@id="'||in_id_user||'"]/alarmwhen';
    
        SELECT count(*)
          INTO count_
          FROM configurator.v_vehicle_configuration vc,
               table(XMLSEQUENCE(EXTRACT(vc.x_configuration,str_))) p
         WHERE vc.id_vehicle = in_id_vehicle;
        
        RETURN count_;
    As this mode of operation:
        SELECT /*+ NO_XMLINDEX_REWRITE */ count(*)
          INTO count_
          FROM configurator.v_vehicle_configuration vc,
               table(XMLSEQUENCE(EXTRACT(vc.x_configuration, '/vehicleconf/GeoFence/spaceTarget[@id="'||in_id_space_target||'"]/user[@id="'||in_id_user||'"]/alarmwhen'))) p
         WHERE vc.id_vehicle = in_id_vehicle;
        
        RETURN count_;
    And also this way it works:
        SELECT count(*)
          INTO count_
          FROM configurator.v_vehicle_configuration vc,
               table(XMLSEQUENCE(EXTRACT(vc.x_configuration, '/vehicleconf/GeoFence/spaceTarget[@id="228"]/user[@id="49"]/alarmwhen'))) p
         WHERE vc.id_vehicle = in_id_vehicle;
        
        RETURN count_;
    I sailed a bit on the internet but I have found no help for my problem...
    I guess that's something concerning the substitution on the fly of the variables, which does not work with an index.
    Do you have any suggestions?
    Is there a way that will prevent the rewriting of all the functions?

    Thanks in advance

    First

    On 11.1.0.6.0 Please do not use table (xmlsequence (extract ())) Please use the SQL/XML standard XMLTAble operator...

    SELECT COUNT(*)
       INTO count_
      FROM configurator.v_vehicle_configuration vc,
               XMLTABLE
              (
                  '$XML/vehicleconf/GeoFence/spaceTarget[@id=$ID_SPACE_TARGET]/user[@id=$ID_USER]/alarmwhen'
                  passing vc.x_configuration as "XML",  in_id_space_target as "ID_SPACE_TARGET",  in_id_user as "ID_USER"
               )
         WHERE vc.id_vehicle = in_id_vehicle;
    
        RETURN count_;
    

    2. never generate XPATH strings dynamically (Note XMLTABLE simply will not allow it). It is almost impossible to optimize since in the case escalated, the query may be a function of the processing line, and it leaves the vulnerable application WHO the problems of injection. Earlier versions of XML DB supported the use of string concatenation technique to provide the value of predicate as a method of implementation of the bind variable, but from what I remember, this is only implemented and tested for storage relatiion object. Even when workng with storage relational object this technique should not be used in the development of new code n a 10.2.x post database. As far as I know this was not implemented for binary XML / XML INdex since the implementations of XMLQUERY, XMLTable and XMLEXists provided a much more robust implementation and standardized to link the underlying values at query runtime

    If you do not know the XPATH expression until run time please build the complete SQL statement dynamically and run it via EXECUTE IMMEDIATE or DBMS_SQL, then pay attention to injection vunerabilities in your application.

    The fact that you get different results seems to be the result of the previous method of binding of predicates works do not correctly with the XML Index. If the solution I gave above does not work, please fill out a bug and that we can continue the investigation

    Published by: mdrake on February 25, 2011 17:32

  • extract returns, extractvalue returns NULL

    I'm in ORACLE 10 g 10.2.0.4.0 there is a PROBLEM (NUMBER of PROBLEMID, XML_COLUMN XMLTYPE) table...

    SELECT PROBLEMID,
    EXTRACT (xml_column, ' / problem/varDefinitions/varDefinition [position () = 1]') end.
    EXTRACTVALUE (j.xml_column, ' / problem/varDefinitions/varDefinition [position () = 1] "") extrval
    PROBLEM;

    Returns:
    PROBLEMID extreme extrval


    377 < var varDefinition = "a" minValue = "8.00" unitsName = "{\rm m/s ^ 2}" maxValue = "12.0" valueStep = "1.00" format = "{3}" / > "

    Hello

    extractValue returns a scalar value (usually a text or attribute node) of a given node, not an instance of XMLType.

    So in your example, varDefinition is an empty element, extractValue gives a NULL value.

    Here is the link to the documentation:
    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14200/functions052.htm#SQLRF06173

  • XMLSequence EXCERPT from HEAD and DETAIL in ORACLE 9.2

    Hi, sorry for my English I'm from Argentina.

    I have this XML:

    <? XML version = "1.0" encoding = "UTF-8" standalone = "yes"? >

    < arrayOfServicio >

    < Service >

    Authentication < number > < / number >

    WS < description > < / description >

    < activated > true < / Activo >

    < version > 1.0 < / Version >

    < MetodosEntity >

    < Metodo >

    < Number > RequestTicket < / number >

    < activated > true < / Activo >

    < version > 1.0 < / Version >

    < / Metodo >

    < / MetodosEntity >

    < / Servicio >

    < Service >

    Consultas < number > < / number >

    wsConsultas < description > < / description >

    < activated > true < / Activo >

    < version > 1.0 < / Version >

    < MetodosEntity >

    < Metodo >

    < Number > GetVigencia < / number >

    < activated > true < / Activo >

    < version > 1.0 < / Version >

    < / Metodo >

    < Metodo >

    < Number > GetSiniestralidad < / number >

    < activated > true < / Activo >

    < version > 1.0 < / Version >

    < / Metodo >

    < Metodo >

    < Number > GetAgrupados < / number >

    < activated > true < / Activo >

    < version > 1.0 < / Version >

    < / Metodo >

    < Metodo >

    < Number > GetSiniestralidadPorCuil < / number >

    < activated > true < / Activo >

    < version > 1.0 < / Version >

    < / Metodo >

    < / MetodosEntity >

    < / Servicio >

    < Service >

    Referencias < number > < / number >

    wsReferencias < description > < / description >

    < activated > true < / Activo >

    < version > 1.0 < / Version >

    < MetodosEntity >

    < Metodo >

    < Number > TablaReferencia < / number >

    < activated > true < / Activo >

    < version > 1.0 < / Version >

    < / Metodo >

    < Metodo >

    < Number > ListadoReferencia < / number >

    < activated > true < / Activo >

    < version > 1.0 < / Version >

    < / Metodo >

    < / MetodosEntity >

    < / Servicio >

    < Service >

    < Number > General < / number >

    WsGeneral < description > < / description >

    < activated > true < / Activo >

    < version > 1.0 < / Version >

    < MetodosEntity >

    < Metodo >

    < Number > GetServicios < / number >

    < activated > true < / Activo >

    < version > 1.0 < / Version >

    < / Metodo >

    < / MetodosEntity >

    < / Servicio >

    < Service >

    < Number > eServicios < / number >

    wseServicios < description > < / description >

    < activated > true < / Activo >

    < version > 1.0 < / Version >

    < MetodosEntity >

    < Metodo >

    < Number > SetComunicacion < / number >

    < activated > true < / Activo >

    < version > 1.0 < / Version >

    < / Metodo >

    < / MetodosEntity >

    < / Servicio >

    < Service >

    < Number > VentanillaART < / number >

    wsVentanillaART < description > < / description >

    < activated > true < / Activo >

    < version > 1.0 < / Version >

    < MetodosEntity >

    < Metodo >

    < Number > ObtenerNovedades < / number >

    < activated > true < / Activo >

    < version > 1.0 < / Version >

    < / Metodo >

    < / MetodosEntity >

    < / Servicio >

    < Service >

    Establishments < number > < / number >

    wsEstablecimiento < description > < / description >

    < activated > true < / Activo >

    < version > 1.0 < / Version >

    < MetodosEntity >

    < Metodo >

    < Number > GetConsultaPorCuit < / number >

    < activated > true < / Activo >

    < version > 1.0 < / Version >

    < / Metodo >

    < / MetodosEntity >

    < / Servicio >

    < / arrayOfServicio >

    I work in ORACLE 9.2 and I wrote this query, but the result is not correct, I need join HEAD and DETAIL in a certain way, but can not do...

    Select extractvalue (value (head), '//Servicio/Nombre/text ()');

    ExtractValue (value (Head), '//Servicio/descripcion/Text ()');

    ExtractValue (value (Head), '//Servicio/Activo/Text ()');

    ExtractValue (value (Head), '//Servicio/version/Text ()')

    , extractvalue (value (retail), '//Metodo/Nombre/text ()')

    , extractvalue (value (retail), '//Metodo/Activo/text ()')

    , extractvalue (value (retail), '//Metodo/Version/text ()')

    of arwt_ws_return x

    , table (xmlsequence (extract (x.x_xmldoc, ' / arrayOfServicio/Servicio '))) Chief

    , table (xmlsequence (extract (x.x_xmldoc, ' / arrayOfServicio, Servicio, MetodosEntity, Metodo'))) in detail;

    II really appreciate your help.

    Thank you!

    Hello

    You can do so by the head of the second XMLSequence element. In this way, you keep the correlation between the parent and its children:

    Select extractvalue (value (head), ' / Servicio/number ') as srv_nombre

    ExtractValue (value (head), ' / Servicio/Descripción ') as srv_desc

    ExtractValue (value (head), ' / Servicio/Activo ") as srv_activo

    ExtractValue (value (head), ' / Servicio/Version ') as srv_version

    ExtractValue (value (retail), ' / method/number ') as met_nombre

    ExtractValue (value (retail), ' / Método/Activo ") as met_activo

    ExtractValue (value (retail), ' / Método/Version ') as met_version

    of arwt_ws_return x

    , table (xmlsequence (extract (x.x_xmldoc, ' / arrayOfServicio/Servicio '))) Chief

    table (xmlsequence (extract (value (head), ' / MetodosEntity/Servicio/Metodo "))) in detail

    ;

    Please also note:

    -you don't need a descendant axis (/ /) If you know the exact path

    -you don't need to go to the text() node if you use extractvalue

    Hope that helps.

  • XMLTable performance vs TABLE (XMLSequence ())

    Hello world

    I encountered a problem which I hope I can find help with.

    He has a task to analyze a large XML text (~ 15 MB) and update a table based on it. So I created a procedure that takes a parameter of XMLType and does the job. Pretty simple. However, the thing is that if I use XMLTable, which is the preferred method to parse the XML, it runs for hours. Once I replace XMLTable with the method TABLE (XMLSequence ()), the procedure ends in less than two minutes on the same machine. Seems very strange to me.

    Any ideas what could be the cause of such a poor performance from XMLTable?
    Oracle version is 11.2.0.2.0

    H1. The table structure
    create table Points (
      member_id int not null,
      point_id int,
      country_numeric character(3),
      place national character varying(50),
      name national character varying(255),
      currencies national character varying(255),
      address national character varying(255),
      contact national character varying(40),
      contact_phone national character varying(40),
      details national character varying(255),
      enabled_date date,
      works national character varying(255),
      active character default 1 check (active in (0, 1)) not null,
      unique (member_id, point_id)
    );
    H1. XMLTable method
    runs for several hours, if the input parameter is long of ~ 15 MB
      create procedure update_Points (
        p_Points in xmltype
      ) as
      begin
        insert into Points (member_id, point_id, country_numeric, place, name, currencies, address, contact, contact_phone, details, enabled_date, works)
        select
          ap.member_id,
          ap.point_id,
          ap.country_numeric,
          ap.place,
          ap.name,
          ap.currencies,
          ap.address,
          ap.contact,
          ap.contact_phone,
          ap.details,
          to_date(ap.enabled_date, 'DD.MM.YYYY'),
          ap.works
        from
          xmltable('for $Point in /document/directory/reply[@type=''Points'']/data/row return element Point { attribute member_id { $Point/column[@col=''1'']/@value }, attribute point_id { $Point/column[@col=''2'']/@value }, attribute country_numeric { $Point/column[@col=''3'']/@value }, attribute place { $Point/column[@col=''4'']/@value }, attribute name { $Point/column[@col=''5'']/@value }, attribute currencies { $Point/column[@col=''6'']/@value }, attribute address { $Point/column[@col=''7'']/@value }, attribute contact { $Point/column[@col=''8'']/@value }, attribute contact_phone { $Point/column[@col=''9'']/@value }, attribute details { $Point/column[@col=''10'']/@value }, attribute enabled_date { $Point/column[@col=''11'']/@value }, attribute works { $Point/column[@col=''12'']/@value } }'
            passing p_Points
            columns
              member_id int path '@member_id',
              point_id int path '@point_id',
              country_numeric character(3) path '@country_numeric',
              place national character varying(50) path '@place',
              name national character varying(255) path '@name',
              currencies national character varying(255) path '@currencies',
              address national character varying(255) path '@address',
              contact national character varying(40) path '@contact',
              contact_phone national character varying(40) path '@contact_phone',
              details national character varying(255) path '@details',
              enabled_date character(10) path '@enabled_date',
              works national character varying(255) path '@works') ap;
      end;
    H1. Method table (XMLSequence ())
    2 minutes with the same input parameter
      create procedure update_Points (
        p_Points in xmltype
      ) as
      begin
        insert into Points (member_id, point_id, country_numeric, place, name, currencies, address, contact, contact_phone, details, enabled_date, works)
        select
          value(x).extract('row/column[@col=''1'']/@value').getStringVal() member_id,
          value(x).extract('row/column[@col=''2'']/@value').getStringVal() point_id,
          value(x).extract('row/column[@col=''3'']/@value').getStringVal() country_numeric,
          value(x).extract('row/column[@col=''4'']/@value').getStringVal() place,
          extractValue(value(x), '/row/column[@col=''5'']/@value') name,
          value(x).extract('row/column[@col=''6'']/@value').getStringVal() currencies,
          value(x).extract('row/column[@col=''7'']/@value').getStringVal() address,
          value(x).extract('row/column[@col=''8'']/@value').getStringVal() contact,
          value(x).extract('row/column[@col=''9'']/@value').getStringVal() contact_phone,
          value(x).extract('row/column[@col=''10'']/@value').getStringVal() details,
          to_date(value(x).extract('row/column[@col=''11'']/@value').getStringVal(), 'DD.MM.YYYY') enabled_date,
          value(x).extract('row/column[@col=''12'']/@value').getStringVal() works
        from
          table(xmlsequence(extract(p_Points, '/document/directory/reply[@type=''Points'']/data/row'))) x;
      end;
    H1. Small example of XML
    <?xml version="1.0"?>
    <document>
      <directory>
        <reply type="Points">
          <data>
            <row>
              <column col="1" value="0"></column>
              <column col="2" value=""></column>
              <column col="3" value="643"></column>
              <column col="4" value="Something"></column>
              <column col="5" value="&quot;Sample&quot;"></column>
              <column col="6" value=""></column>
              <column col="7" value="Blah"></column>
              <column col="8" value="Bar"></column>
              <column col="9" value="0123456789"></column>
              <column col="10" value=""></column>
              <column col="11" value="01.01.2010"></column>
              <column col="12" value=""></column>
            </row>
          </data>
        </reply>
      </directory>
    </document>
    Published by: 999663 on April 15, 2013 13:21

    Because you have them different tasks. With the XML Table, you create a game via the return of intermediate results. Why not use the same approach to Table (XMLSequence ()) as in

        select
          ap.member_id,
          ap.point_id,
          ap.country_numeric,
          ap.place,
          ap.name,
          ap.currencies,
          ap.address,
          ap.contact,
          ap.contact_phone,
          ap.details,
          to_date(ap.enabled_date, 'DD.MM.YYYY'),
          ap.works
        from
          xmltable('/document/directory/reply[@type=''Points'']/data/row'
            passing p_Points
            columns
              member_id int path 'column[@col="1"]/@value',
              point_id int path 'column[@col="2"]/@value',
              country_numeric character(3) path 'column[@col="3"]/@value',
              place national character varying(50) path 'column[@col="4"]/@value',
              name national character varying(255) path 'column[@col="5"]/@value',
              currencies national character varying(255) path 'column[@col="6"]/@value',
              address national character varying(255) path 'column[@col="7"]/@value',
              contact national character varying(40) path 'column[@col="8"]/@value',
              contact_phone national character varying(40) path 'column[@col="9"]/@value',
              details national character varying(255) path 'column[@col="10"]/@value',
              enabled_date character(10) path 'column[@col="11"]/@value',
              works national character varying(255) path 'column[@col="12"]/@value') ap;
    

    I hope it works now as fast as the old method, but you will need to provide the statistics on that. I'm interested to see the moment of execution.

    Now if you want it to run faster, then

    CREATE TABLE xml_hold (xml_col xmltype);  -- can be a global temporary table if you desire
    

    and in your code

    INSERT INTO xml_hold VALUES (p_points);
    

    then change select it above to

        from xml_hold xh
          xmltable('/document/directory/reply[@type=''Points'']/data/row'
            passing xh.xml_col
    

    This works because the default storage for XMLType columns in 11.2.0.2 was replaced by SECUREFILE XML BINARY. When you store XML in this column, Oracle preprocesses the XML file and stores the data in a binary format that is more effective to deal with. You can read about that in the Oracle documentation if you wish. Even with the charge to convert the XML into an internal format, the whole processing time should be faster given the application can now run much more efficiently.

  • Extract the value of the XML column.

    Hello

    I'm on 11.2.0.3 and got query
    select other_xml from v$sql_plan where sql_id=’2y32qkr40b82a’ and other_xml is not null
    
    <other_xml><info type="db_version">11.2.0.3</info>
    <info type="parse_schema"><![CDATA["LIU"]]></info><info type="dynamic_sampling">2</info>
    <info type="plan_hash">3882242470</info><info type="plan_hash_2">281948136</info>
    <peeked_binds><bind nam=":N1" pos="1" dty="2" pre="0" scl="0" mxl="22">c30d51</bind>
    <bind nam=":N2" pos="2" dty="2" pre="0" scl="0" mxl="22">c30d51</bind>
    <bind nam=":N3" pos="3" dty="2" pre="0" scl="0" mxl="22">c30d51</bind></peeked_binds>
    <outline_data><hint><![CDATA[IGNORE_OPTIM_EMBEDDED_HINTS]]></hint>
    <hint><![CDATA[OPTIMIZER_FEATURES_ENABLE('11.2.0.3')]]></hint>
    <hint><![CDATA[DB_VERSION('11.2.0.3')]]></hint>
    <hint><![CDATA[FIRST_ROWS(100)]]></hint>
    <hint><![CDATA[OUTLINE_LEAF(@"SEL$1")]]></hint>
    <hint><![CDATA[FULL(@"SEL$1" "LIU"@"SEL$1")]]></hint>
    </outline_data></other_xml>
    I want to output associated to < type info = "dynamic_sampling" > 2 < / info >:

    dynamic_sampling of name of column
    value of line 2

    reflection by using dynamic_sampling value as a predicate would be great if:

    Select * from v$ sql_plan
    where
    dynamic_sampling = 2

    How to transform the other_xml column to get such results?


    Concerning
    GregG

    Published by: GregG on February 8, 2013 13:14

    XMLTABLE is a better way to do it as EXTRACTVALUE is obsolete but:

    select p.sql_id,  extractvalue(h.column_value,'/info') lvl
    from   v$sql_plan p
    ,      table(xmlsequence(extract(xmltype(p.other_xml),'/other_xml/info'))) h
    where  p.other_xml is not null
    and    extractvalue(h.column_value,'/info/@type') = 'dynamic_sampling';
    

    11.1 I think the tag can say 'yes' rather than giving level.
    If there is no dynamic sampling, there should be no tag dynamic sampling.

  • Extract data from a different node in SQL

    Hi friends,

    First of all:
            BANNER
    1     Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    2     PL/SQL Release 11.2.0.3.0 - Production
    3     CORE     11.2.0.3.0     Production
    4     TNS for Linux: Version 11.2.0.3.0 - Production
    5     NLSRTL Version 11.2.0.3.0 - Production
    I have a small but annoying problem. I have create a Bank application that needs to retrieve data in a file entry, and, according to this information, to execute some stored procedures (create a new customer, create a new account, create a transaction for an account).
    For example: the input file contains a few new customers (FirstName, LastName, SocialSecurityNumber, birthday, address and PhoneNo), for each customer account at least 1 create 1 or more operations (the amount of the transaction) for each account.

    Let me be more precise. It is a XML in an input file:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <doc>
      <PERS_INFO>
        <lastname>John</lastname>
        <firstname>Doe</firstname>
        <social_security_no>1800325171545</social_security_no>
        <birthday>25/03/1980</birthday>
        <address>Principal, 15</address>
        <phoneno>0040722222222</phoneno>
        <acc>
          <transaction>200</transaction>
          <transaction>150</transaction>
          <transaction>-23</transaction>
        </acc>
        <acc>
          <transaction>450</transaction>
        </acc>
        <acc>
          <transaction>800</transaction>
          <transaction>320</transaction>
          <transaction>-125</transaction>
        </acc>
      </PERS_INFO>
      <PERS_INFO>
        <lastname>Smith</lastname>
        <firstname>Pop</firstname>
        <social_security_no>2851211173377</social_security_no>
        <birthday>11/12/1985</birthday>
        <address>FirstAvenue, 20</address>
        <phoneno>0040744444444</phoneno>
        <acc>
          <transaction>444</transaction>
          <transaction>550</transaction>
        </acc>
        <acc>
          <transaction>113</transaction>
          <transaction>-50</transaction>
          <transaction>89</transaction>
        </acc>
        <acc>
          <transaction>300</transaction>
        </acc>
      </PERS_INFO>
    </doc>
    This input file must start the following:

    -create 2 new clients (using a stored procedure Pr_Add_New_Cust):
    1 John Doe / 1800325171545 / 25.03.1980 / main, 15 / 0040722222222
    2 Smith Pop / 2851211173377 / 11.12.1985 / FirstAvenue, 20 / 0040744444444

    -for John Doe I create 3 new account (using a stored procedure Pr_Add_New_Account):
    -account 1 - for this account, I have to create 3 new operations (using a stored procedure Pr_Create_New_Trans): DEPOSIT $ 200, $ 150 DEPOSIT, WITHDRAW $ 23
    -account 2 - for this account, I need to create 1 new operations (using a stored procedure Pr_Create_New_Trans): DEPOSIT $ 450
    -count of 3 - for this account, I have to create 3 new operations (using a stored procedure Pr_Create_New_Trans): DEPOSIT $ 800, DEPOSIT $ 320, WITHDRAWAL $ 125

    -for Smith Pop I create 3 new account (using a stored procedure Pr_Add_New_Account):
    -account 1 - for this account, I need to create 2 new operations (using a stored procedure Pr_Create_New_Trans): DEPOSIT $ 444, DEPOSIT $ 550
    -account 2 - for this account, I have to create 3 new operations (using a stored procedure Pr_Create_New_Trans): DEPOSIT $ 113, WITHDRAW $50, DEPOSIT $ 89
    -count of 3 - for this account, I need to create 1 new operations (using a stored procedure Pr_Create_New_Trans): DEPOSIT $ 300


    Well, I think to do that by loading this XML into a table of staging pre - INS_STG1 - (the part of loading is not an issue at the moment) and by analyzing the XML code in order to get my (insert) in the second staging table INS_STG2 the information required to initiate these procedures.
    Something like that (at the moment I only insert customer information since I do not know how to get on the floor):
    DECLARE  
    
       TYPE ty_rec_1    IS RECORD (v_cust_firstname       VARCHAR2(32),
                                   v_cust_lastname        VARCHAR2(32),
                                   v_cust_persnumcode     VARCHAR2(32),
                                   v_cust_birthday        VARCHAR2(32),
                                   v_cust_address         VARCHAR2(32),
                                   v_cust_phoneno         VARCHAR2(32));
       TYPE ty_cur_1       IS REF CURSOR RETURN ty_rec_1;
       TYPE ty_arr_rec_1   IS TABLE OF ty_rec_1 INDEX BY PLS_INTEGER;
       cur_1               ty_cur_1;
       arr_rec_1           ty_arr_rec_1;
       my_xml              xmltype;
       N_BULK_SIZE         NUMBER := 1000;
      
    BEGIN 
      
      SELECT xml_column INTO my_xml FROM INS_STG1;
      
      OPEN cur_1 FOR
        SELECT extractvalue(column_value, '/PERS_INFO/firstname')          "v_cust_firstname",
               extractvalue(column_value, '/PERS_INFO/lastname')           "v_cust_lastname",
               extractvalue(column_value, '/PERS_INFO/social_security_no') "v_cust_persnumcode",
               extractvalue(column_value, '/PERS_INFO/birthday')           "v_cust_birthday",
               extractvalue(column_value, '/PERS_INFO/address')            "v_cust_address",
               extractvalue(column_value, '/PERS_INFO/phoneno')            "v_cust_phoneno"       
        FROM TABLE(XMLSequence(my_xml.extract('/doc/PERS_INFO'))) t;
    
        LOOP
           FETCH cur_1 BULK COLLECT INTO arr_rec_1 LIMIT N_BULK_SIZE;
           EXIT WHEN arr_rec_1.COUNT() = 0;
           FORALL n_idx1 IN 1..arr_rec_1.COUNT()
             INSERT INTO INS_STG2
               (cust_firstname, cust_lastname, cust_persnumcode, cust_birthday, cust_address, cust_phoneno)
              VALUES 
              (arr_rec_1(n_idx1).v_cust_firstname, arr_rec_1(n_idx1).v_cust_lastname, 
               arr_rec_1(n_idx1).v_cust_persnumcode, arr_rec_1(n_idx1).v_cust_birthday, 
               arr_rec_1(n_idx1).v_cust_address, arr_rec_1(n_idx1).v_cust_phoneno);
         END LOOP;
       CLOSE cur_1;  
      COMMIT;              
    
    END;
    This procedure is based on the SQL query that I'm starting to fold with in order to understand how to get the information from XML using SQL (the XML is hardcoded)
    SELECT extractvalue(column_value, '/PERS_INFO/firstname')    "First Name",
           extractvalue(column_value, '/PERS_INFO/lastname')     "Last Name",
           extractvalue(column_value, '/PERS_INFO/social_security_no')  "Social Security No",
           extractvalue(column_value, '/PERS_INFO/birthday')     "Birth-day",
           extractvalue(column_value, '/PERS_INFO/address')      "Address",
           extractvalue(column_value, '/PERS_INFO/phoneno')      "Phone No"
      FROM TABLE(XMLSequence(
                 XMLTYPE(
                 '<?xml version="1.0" encoding="ISO-8859-1"?>
                  <doc>
                    <PERS_INFO>
                      <lastname>John</lastname>
                      <firstname>Doe</firstname>
                      <social_security_no>1800325171545</social_security_no>
                      <birthday>25/03/1980</birthday>
                      <address>Principal, 15</address>
                      <phoneno>0040722222222</phoneno>
                      <acc>
                        <transaction>200</transaction>
                        <transaction>150</transaction>
                        <transaction>-23</transaction>
                      </acc>
                      <acc>
                        <transaction>450</transaction>
                      </acc>
                      <acc>
                        <transaction>800</transaction>
                        <transaction>320</transaction>
                        <transaction>-125</transaction>
                      </acc>
                    </PERS_INFO>
                    <PERS_INFO>
                      <lastname>Smith</lastname>
                      <firstname>Pop</firstname>
                      <social_security_no>2851211173377</social_security_no>
                      <birthday>11/12/1985</birthday>
                      <address>FirstAvenue, 20</address>
                      <phoneno>0040744444444</phoneno>
                      <acc>
                        <transaction>444</transaction>
                        <transaction>550</transaction>
                      </acc>
                      <acc>
                        <transaction>113</transaction>
                        <transaction>-50</transaction>
                        <transaction>89</transaction>
                      </acc>
                      <acc>
                        <transaction>300</transaction>
                      </acc>
                    </PERS_INFO>
                  </doc>').extract('/doc/PERS_INFO'))) t;
    My problem is that this query will only at the first level (the level of the customer). I don't know how to get to the second and third level (transactions/account).
    Now, this query return:
    Doe     John     1800325171545     25/03/1980     Principal, 15     0040722222222
    Pop     Smith     2851211173377     11/12/1985     FirstAvenue, 20     0040744444444
    and I want him back like this:
    Doe     John     1800325171545     25/03/1980     Principal, 15     0040722222222  1   200
    Doe     John     1800325171545     25/03/1980     Principal, 15     0040722222222  1   150
    Doe     John     1800325171545     25/03/1980     Principal, 15     0040722222222  1  -23
    Doe     John     1800325171545     25/03/1980     Principal, 15     0040722222222  2   450
    Doe     John     1800325171545     25/03/1980     Principal, 15     0040722222222  3   800
    Doe     John     1800325171545     25/03/1980     Principal, 15     0040722222222  3   320
    Doe     John     1800325171545     25/03/1980     Principal, 15     0040722222222  3  -125 
    Pop     Smith     2851211173377     11/12/1985     FirstAvenue, 20     0040744444444  1   444
    Pop     Smith     2851211173377     11/12/1985     FirstAvenue, 20     0040744444444  1   550
    Pop     Smith     2851211173377     11/12/1985     FirstAvenue, 20     0040744444444  2   113
    Pop     Smith     2851211173377     11/12/1985     FirstAvenue, 20     0040744444444  2  -50
    Pop     Smith     2851211173377     11/12/1985     FirstAvenue, 20     0040744444444  2   89
    Pop     Smith     2851211173377     11/12/1985     FirstAvenue, 20     0040744444444  3   300
    What I do for this SQL query to get the result at the transaction level (as in the second table)? This XML can be improved as well. If another structure service for my purpose, please let me know.

    Thank you!

    Like [url http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions061.htm#SQLRF06173] extractvalue is frowned upon in your version, you need to switch to another method, as shown in the documentation.

    Go further with that, here's a starter SQL which gives you the desired result

    WITH INS_STG1 AS
    (SELECT XMLTYPE('
                  
                    
                      John
                      Doe
                      1800325171545
                      25/03/1980
                      
    Principal, 15
    0040722222222 200 150 -23 450 800 320 -125
    Smith Pop 2851211173377 11/12/1985
    FirstAvenue, 20
    0040744444444 444 550 113 -50 89 300
    ') xml_column FROM DUAL ) -- The above simulates your table. Only the below matters. SELECT xt.First_Name, xt.birth_day, xt2.acc_rn, xt3.trans FROM INS_STG1, XMLTable('/doc/PERS_INFO' PASSING INS_STG1.xml_column COLUMNS First_Name VARCHAR2(20) PATH 'firstname', Birth_day VARCHAR2(10) PATH 'birthday', acc_xml XMLType PATH 'acc') xt, XMLTable('/acc' PASSING xt.acc_xml COLUMNS acc_rn FOR ORDINALITY, tran_xml XMLTYPE PATH 'transaction') xt2, XMLTable('/transaction' PASSING xt2.tran_xml COLUMNS trans NUMBER PATH '.') xt3;

    product

    FIRST_NAME           BIRTH_DAY      ACC_RN      TRANS
    -------------------- ---------- ---------- ----------
    Doe                  25/03/1980          1        200
    Doe                  25/03/1980          1        150
    Doe                  25/03/1980          1        -23
    Doe                  25/03/1980          2        450
    Doe                  25/03/1980          3        800
    Doe                  25/03/1980          3        320
    Doe                  25/03/1980          3       -125
    Pop                  11/12/1985          1        444
    Pop                  11/12/1985          1        550
    Pop                  11/12/1985          2        113
    Pop                  11/12/1985          2        -50
    Pop                  11/12/1985          2         89
    Pop                  11/12/1985          3        300
    

    Now... There are probably a better way to XQuery to shoot that turned off, but I'll keep this better than me for someone of XQuery example.

    I'll also include is it possible that all this work could be done in a single SQL statement, as indicated by
    [url http://odieweblog.wordpress.com/2012/05/10/how-to-load-xml-data-into-multiple-tables/] How to: Load XML data in multiple tables

  • XML - ORA-19025: EXTRACTVALUE returns the value of a single node

    Hello

    I'm new to XML DB. Can someone help me with the below XML

    I use the following XML... (I pasted a part only of it coz I need data only up to this article)

    XML
    --------------------

    <? XML version = "1.0" encoding = "UTF-8"? > < SOAP - ENV:Envelope xmlns:SOAP - ENV = "http://schemas.xmlsoap.org/soap/envelope/" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-."
    example"container ="http://www.w3.org/2001/XMLSchema"> < SOAP - ENV:Body >
    < ns:PicklistWS_GetPicklistValues_Output xmlns:ns = "urn: crmondemand/ws/list dropdown /" >
    < ListOfParentPicklistValue xmlns = "urn: / xml/crmondemand/list of choices" >
    < ParentPicklistValue >
    < language > ENU < / language >
    < ParentFieldName > plProduct_Team < / ParentFieldName >
    < ParentDisplayValue > Marketing On Demand < / ParentDisplayValue >
    < ParentCode > Marketing On Demand < / ParentCode >
    < Disabled > N < / disabled >
    < ListOfPicklistValue >
    < PicklistValue >
    Escalation of OCP/SME < code > < code >
    Escalation of OCP/SME < DisplayValue > < / DisplayValue >
    < Disabled > N < / disabled >
    < / PicklistValue >
    < PicklistValue >
    Ask fusion < code > < code >
    Merge request < DisplayValue > < / DisplayValue >
    < Disabled > N < / disabled >
    < / PicklistValue >



    Code
    ---------




    SELECT distinct
    EXTRACTVALUE (value (SR), ' / ParentPicklistValue/ListOfPicklistValue/PicklistValue/Code ','xmlns = "urn: / crmondemand/xml/list of choices"') AS display.
    Return EXTRACTVALUE (value (SR),'/ ParentPicklistValue/ListOfPicklistValue/PicklistValue/DisplayValue ',' xmlns = "urn: / crmondemand/XML/picklist"'),.
    EXTRACTVALUE (value (SR), '/ ParentPicklistValue/ParentDisplayValue','xmlns = "urn: / crmondemand/XML/picklist"') AS parent_display,
    EXTRACTVALUE (value (SR), '/ ParentPicklistValue/ParentCode','xmlns = "urn: / crmondemand/XML/picklist"') AS parent_return
    TABLE (XMLSEQUENCE ((EXCERPT)
    WEB_SERVICE (' <? xml version = "1.0" encoding = "UTF - 8" standalone = "no"? > < envelope soap: xmlns:soap = "http://schemas.xmlsoap.org/soap/envelope/")
    xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" container = "http://www.w3.org/2001/XMLSchema" >
    < soap: Body >
    < PicklistWS_GetPicklistValues_Input xmlns = "urn: crmondemand/ws/list dropdown /" >
    Type < FieldName > < / FieldName >
    Service request < RecordType > < / RecordType >
    < / PicklistWS_GetPicklistValues_Input >
    < / soap: Body >
    "< / envelope soap: >.
    (' document / urn: crmondemand/ws/list dropdown /: ' GetPicklistValues, Id_de_la_session).
    "/: soap envelope / soap: Body / * / * / * ',' xmlns:soap ="(http://schemas.xmlsoap.org/soap/envelope/'))) SR "


    ERROR
    ---------

    ORA-19025: EXTRACTVALUE returns the value of a single node


    UNDERSTANDING
    ---------------------------

    As my Xpath only points until the node - ParentPicklistValue and not the child nodes under it. That's why, when I try to interview the child nodes - / ParentPicklistValue/ListOfPicklistValue/PicklistValue/Code, I get the error mentioned above.

    REQUIREMENT
    -----------------------

    Can someone help me to receive the values of the mother and child values based on xml and query above.

    Hello

    It's a classic ;)

    You need a second XMLSequence who shreds the collection of PicklistValue in relational lines:

    select extractvalue(value(sr2), '/PicklistValue/Code', 'xmlns="urn:/crmondemand/xml/picklist"') AS Display
         , extractvalue(value(sr2), '/PicklistValue/DisplayValue', 'xmlns="urn:/crmondemand/xml/picklist"') AS Return
         , extractvalue(value(sr1), '/ParentPicklistValue/ParentDisplayValue', 'xmlns="urn:/crmondemand/xml/picklist"') AS parent_display
         , extractvalue(value(sr1), '/ParentPicklistValue/ParentCode', 'xmlns="urn:/crmondemand/xml/picklist"') AS parent_return
    from table(
           xmlsequence(
             extract( WEB_SERVICE( ... )
                    , '/soap:Envelope/soap:Body/ns:PicklistWS_GetPicklistValues_Output/ListOfParentPicklistValue/ParentPicklistValue'
                    , 'xmlns="urn:/crmondemand/xml/picklist"
                       xmlns:ns="urn:crmondemand/ws/picklist/"
                       xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"' )
           )
         ) sr1
       , table(
           xmlsequence(
             extract( value(sr1)
                    , '/ParentPicklistValue/ListOfPicklistValue/PicklistValue'
                    , 'xmlns="urn:/crmondemand/xml/picklist"' )
           )
         ) sr2
    ;
    

    What is your version of the database BTW?
    10.2 and upward, you can use the XMLTable.

  • XMLSEQUENCE or XMLTABLE

    I'm XML file I have loaded like a BLOB, then converted into a XML_TYPE and converted into a CLOB

    I use the following SQL code to extract the data

    the table is imp_xml_file and the column is xml_xml
    select  
    x.xml_xml.extract('aircraft/brochure/part/partNumber/text()').getstringval() as partno,
    x.xml_xml.extract('aircraft/brochure/part/NSCM/text()').getstringval() as NCSM, 
    x.xml_xml.extract('aircraft/brochure/part/LCN/text()').getstringval() as LCN,
    x.xml_xml.extract('aircraft/brochure/part/zone/text()').getstringval() as PZONE,
    from imp_xml_file x,table(xmlsequence(extract(xml_xml, '/aircraft/brochure/part'))) d
    where id = p_id
    
    there are 7 records in the XML file 
    
    if i use table(xmlsequence(extract(xml_xml, '/aircraft/brochure/part'))) d
    
    it returns 7 rows and each column but all data is concatenated for each field  
    
    if i use table(xmlsequence(extract(xml_xml, '/aircraft/brochure/'))) d
    it returns 1 with all the fileds concatenated 
    
    this is the data
    <?xml version="1.0" standalone="yes" ?> 
    - <aircraft>
      <buildNumber>BS059</buildNumber> 
    - <brochure>
      <dataSource>Centre Fuselage EPC Handover Brochure</dataSource> 
      <autoGeneratePhysicalPartRecords>YES</autoGeneratePhysicalPartRecords> 
      <importSerialNumbersInstallationDates>YES</importSerialNumbersInstallationDates> 
    - <part>
      <NSCM>98441</NSCM> 
      <partNumber>743900-1</partNumber> 
      <serialNumber>EFA0276</serialNumber> 
      <LCN>X291211</LCN> 
      <zone>267</zone> 
      <logCardRequired>-</logCardRequired> 
      <installationDate>05/09/2008 00:00:00:000</installationDate> 
      </part>
    - <part>
      <NSCM>98441</NSCM> 
      <partNumber>743900-2</partNumber> 
      <serialNumber>EFA0276</serialNumber> 
      <LCN>X291111</LCN> 
      <zone>257</zone> 
      <logCardRequired>-</logCardRequired> 
      <installationDate>05/09/2008 00:00:00:000</installationDate> 
      </part>
    - <part>
      <NSCM>98441</NSCM> 
      <partNumber>743900-3</partNumber> 
      <serialNumber>EFA0272</serialNumber> 
      <LCN>X291226</LCN> 
      <zone>267</zone> 
      <logCardRequired>-</logCardRequired> 
      <installationDate>12/08/2008 00:00:00:000</installationDate> 
      </part>
    - <part>
      <NSCM>98441</NSCM> 
      <partNumber>743900-4</partNumber> 
      <serialNumber>EFA0271</serialNumber> 
      <LCN>X291126</LCN> 
      <zone>257</zone> 
      <logCardRequired>-</logCardRequired> 
      <installationDate>11/08/2008 00:00:00:000</installationDate> 
      </part>
    - <part>
      <NSCM>98441</NSCM> 
      <partNumber>743900-5</partNumber> 
      <serialNumber>EFA-0265</serialNumber> 
      <LCN>X291227</LCN> 
      <zone>267</zone> 
      <logCardRequired>-</logCardRequired> 
      <installationDate>24/07/2008 00:00:00:000</installationDate> 
      </part>
    - <part>
      <NSCM>98441</NSCM> 
      <partNumber>743900-6</partNumber> 
      <serialNumber>EFA-0263</serialNumber> 
      <LCN>X291127</LCN> 
      <zone>257</zone> 
      <logCardRequired>-</logCardRequired> 
      <installationDate>21/07/2008 00:00:00:000</installationDate> 
      </part>
    - <part>
      <NSCM>D1227</NSCM> 
      <partNumber>743900-7</partNumber> 
      <serialNumber>08060258</serialNumber> 
      <LCN>X212301</LCN> 
      <zone>274</zone> 
      <logCardRequired>-</logCardRequired> 
      <installationDate>01/08/2008 00:00:00:000</installationDate> 
      </part>
     </brochure>
      </aircraft>
    
    This is how the data is returned
    
    PARTNO     NCSM     LCN     PZONE
    
    743900-1743900-2743900-3743900-4743900-5743900-6743900-7     984419844198441984419844198441D1227     X291211X291111X291226X291126X291227X291127X212301     267257267257267257274
    743900-1743900-2743900-3743900-4743900-5743900-6743900-7     984419844198441984419844198441D1227     X291211X291111X291226X291126X291227X291127X212301     267257267257267257274
    743900-1743900-2743900-3743900-4743900-5743900-6743900-7     984419844198441984419844198441D1227     X291211X291111X291226X291126X291227X291127X212301     267257267257267257274
    743900-1743900-2743900-3743900-4743900-5743900-6743900-7     984419844198441984419844198441D1227     X291211X291111X291226X291126X291227X291127X212301     267257267257267257274
    743900-1743900-2743900-3743900-4743900-5743900-6743900-7     984419844198441984419844198441D1227     X291211X291111X291226X291126X291227X291127X212301     267257267257267257274
    743900-1743900-2743900-3743900-4743900-5743900-6743900-7     984419844198441984419844198441D1227     X291211X291111X291226X291126X291227X291127X212301     267257267257267257274
    743900-1743900-2743900-3743900-4743900-5743900-6743900-7     984419844198441984419844198441D1227     X291211X291111X291226X291126X291227X291127X212301     267257267257267257274
    Any help greatly appreciated, all the examples seem to cover only 1 card in the XMLTYPE and it works very well with 1 card!
    not with 1 > :-((

    Chris

    Published by: CJ Bell on November 29, 2011 11:23

    Published by: CJ Bell on November 29, 2011 11:24

    Hi Chris,

    That's what you want:

    select extractvalue(x.column_value, '/part/partNumber') as PARTNO,
           extractvalue(x.column_value, '/part/NSCM') as NCSM,
           extractvalue(x.column_value, '/part/LCN') as LCN,
           extractvalue(x.column_value, '/part/zone') as PZONE
    from imp_xml_file t
       , table(
           xmlsequence(
             extract(t.xml_xml, '/aircraft/brochure/part'))
         ) x
    where id = p_id
    ;
    

    What is your version of the database? (select * from version$ v)
    From 10.2, XMLTable can do the same and much more.

    I'm XML file I have loaded like a BLOB, then converted into a XML_TYPE and converted into a CLOB

    Once again, depending on your version, you can load your file directly into the table with an INSERT.

Maybe you are looking for

  • How can I activate iCloud off the coast for good?

    Without my permission, after that I refused and re-itself has denied permission for more than a year, is responsible in the gills with pictures from my PHOTO app. They are not pictures of me robbing banks, however, I don't want anything of mine on an

  • I can see, but cannot add to the family calendar sharing. What I am doing wrong?

    My daughters iPad and iPhone don't allow him to add to our family calendar. She can see the calendar. I tried a reset and disconnection of the two devices. It works on devices of my son.

  • Strange problem with adapter on my Satellite A40

    Hello world I bought Toshiba Satellite A40-221 more than year a go and it works perfectly. I m maybe a heavy user I have working on it in the average of 12 hours. Sometimes I work in manufacturing, especially graphics 3d next to games. last month, th

  • Version of Windows 64-bit Server and the remote your 2161DS-2 console switch

    I have a Dell 2 your 2161DS remote console switch connected to the servers of 7 or 8.  Recently, I removed several servers and install 3 new devices; a Windows Server 2003 (32-bit) system; a system of Windows Unified Data Storage Server 2003 (64-bit)

  • How call "application selector.

    Hi all I tried to add the issue of the 'apply changes' on the menu in my applications but could not. Although I found some code snippets describing how to create a custom pop-up to simulate this, I am not satisfied with the results. In addition, I'm