Extraction of a node in an XMLtype table - selection of the previous query

Hey all,.

I work with a server Oracle 11 g r2 and basically need to be able to analyse and select nodes from it. I spent hours scouring the net and reading the manual oracle xml db trying to find an appropriate solution to my problem, but I can't seem to identify the correct way to do it. I have some experience in programming, but none with databases oracle, sql or xml in general so forgive me if this is a trivial question.

OK, so the question:

I have a very simple XML file saved under catalog.xml and it is as follows:

<>Catalog
< cd >
< title > hide your heart < /title >
< artist > Bonnie Tyler < / artist >
< Country > UK < / country >
< company > CBS Records < / company >
< price > 9.90 < / price >
< year > 1988 < / year >
< CD >
< cd >
Empire Burlesque < title > < /title >
< artist > Bob Dylan < / artist >
< country > USA < / country >
< company > Columbia < / company >
< price > 10.90 < / price >
< year > 1985 < / year >
< CD >
< / catalogue >

Now, I want to be able to extract the title of the given cd a certain artist. So, for example, if the artist is "bob dylan", the title should be "empire burlesque".

Now I created an XMLType table in Oracle as follows:

CREATE BINARY XMLTYPE STORE AS XML BINARY XMLType TABLE.

I then load my xml file into oracle by:

Insert the BINARY values (XMLTYPE (BFILENAME ('XML_DIR', 'catalog.xml'), nls_charset_id ('AL32UTF8')));

So far so good.

Now for the part of the excerpt:

First of all I've tried:

SELECT extract (b.object_value, ' / catalogue/cd/title ')
Binary b
WHERE existsNode (b.object_value,'/catalog/cd [artist = "Bob Dylan"]') = 1;

EXTRACT(B.OBJECT_VALUE,'/CATALOG/CD/TITLE')
--------------------------------------------------------------------------------

< title > hide your heart < /title >
Burlesque Empire < title > < /title >

1 selected line.



It did not work because the xml file was all in 1 row then I realized that I had to split my xml in separate rows. Doing that, I had to convert the nodes < title > a virtual table using the functions XMLSequence() and table(). These functions convert nodes two title returned by the extract() function in a virtual table composed of two XMLType objects, each of which contains a single title element.

Second test:

SELECT value (d)
Binary B,
Table (xmlsequence(extract(b.object_value,'/catalog/cd'))) d
WHERE existsNode (b.object_value,'/catalog/cd [artist = "Bob Dylan"]') = 1;

VALUE (D)
--------------------------------------------------------------------------------

< cd >
< title > hide your heart < /title >
< artist > Bonnie Tyler < / artist >
< Country > UK < / country >
< company > CBS Records < / company >
< price > 9.90 < / price >
< year > 1988 < / year >
< CD >

< cd >
Empire Burlesque < title > < /title >
< artist > Bob Dylan < / artist >
< country > USA < / country >
< company > Columbia < / company >
< price > 10.90 < / price >
< year > 1985 < / year >
< CD >

2 selected lines.


It's better because it is now divided into 2 different lines so I should be able to make a selection - where, and then select the title from the artist.

However, this is where I have questions, I tried to literally hours but I can't understand how to use the results of the query above in my next. So I tried to use a suquery in this way:

Select extract (sub1, ' cd/title')
Of
(
SELECT value (d)
Binary B,
Table (xmlsequence(extract(b.object_value,'/catalog/cd'))) d
) sub1
WHERE existsNode (sub1,'/ cd [artist = "Bob Dylan"]') = 1;

However, sql * plus displays an error:

ORA-00904: "SUB1": invalid identifier.

I've tried dozens of variations to try to use subqueries but I simly can't do things.

I heard you can do also do this using variables or pl/sql, but I don't know where to start.

Any help would be greatly appreciated I tried everything at my disposal.

This should help you get started!

select banner as "Oracle version" from v$version where banner like 'Oracle%';

create table otn5test(
  id number,
  data xmltype
);

insert into otn5test values (1, xmltype('

Hide your heart
Bonnie Tyler
UK
CBS Records
9.90
1988


Empire Burlesque
Bob Dylan
USA
Columbia
10.90
1985


'));

select otn5test.id, x.*
from otn5test,
     xmltable('/catalog/cd[artist/text()="Bob Dylan"]' passing otn5test.data
     columns title varchar2(20) path 'title') x;

select otn5test.id,
       xmlcast(xmlquery('/catalog/cd[artist/text()="Bob Dylan"]/title'
               passing otn5test.data returning content)
       as varchar2(20)) from otn5test;

drop table otn5test;
sqlplus> @otn-5.sql

Oracle version
------------------------------------------------------------------------------
Oracle Database 11g Release 11.2.0.1.0 - 64bit Production

Table created.

1 row created.

     ID TITLE
---------- --------------------
      1 Empire Burlesque

     ID XMLCAST(XMLQUERY('/C
---------- --------------------
      1 Empire Burlesque

Table dropped.

Tags: Database

Similar Questions

  • Insert row into table 2D retaining the previous values

    Amendment of data entered in a 2D array and also displayed a table. When the time rolls 3 columns of data are held and then created line. Problem is the line moves downwards, but the previous data is not stored. I tried using shift register, but that only auto markings lines table to fill as the iteration of the loop. Looks like a basic really simple problem but going round in circles on this one there...

    In this case, the function 'Replace table subset' is what is needed to replace the last values in line with the current values of the user interface.

    On the evolution of the time, an addition occurs.

    An update of the VI is attached.

  • [11g] ORA-31061/ORA-19202 - how to insert data xmltype table/validation of the schema (just well formed)

    Hello

    Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production

    PL/SQL Release 11.2.0.3.0 - Production

    CORE Production 11.2.0.3.0

    AMT for Linux: Version 11.2.0.3.0 - Production

    NLSRTL Version 11.2.0.3.0 - Production

    Here's the demo program:

    ==============================

    create a global temporary table GTT_Test(data xmltype) validation delete rows;

    - and run this

    declare

    v_data xmltype.

    Start

    -It does not work

    /*

    v_data: = xmltype ("< itf:meta > < node / > < / itf:meta > '");

    */

    - but it works

    v_data: = xmltype)

    XMLDATA = > ' < my: meta > < node / > < / my: meta > ',

    schema = > null,

    validated = > 0,

    correct = > 1);

    - but try to insert into the table in the same way fails again:

    insert into GTT_Test (data)

    values (xmltype)

    XMLDATA = > ' < my: meta > < node / > < / my: meta > ',

    schema = > null,

    validated = > 0,

    correct = > 1));

    end;

    ==============================


    It translates errors ORA above and suspicion: "prefix 'my' is not declared".


    I need to create the TWG somehow different to accept without diagram validation?


    -Thanks!


    Kind regards

    Frank

    Hello.

    Try to declare to your XML namespace.

    for examplehttp://youaddress">

    "If you don't have a schema, try xmlns: my =" "(espace en blanc)."

  • Dial the node library with cluster table feature using the pointer of table data

    Hi all.

    I am writing a wrapper of LabVIEW for an existing DLL function.

    The service was, as one of its parameters, an array of structures.  The structure is very simple, containing two integers.  I use the call library function node to access.

    In Labview, I created an array of clusters, when the cluster has two integers of 32 bits as members.  So far so good.

    Now, I have to pass this in the node library function call.  I use here in trouble.

    I used the LAVA so the topic in the knowledge base as my main sources of information, although I read a lot of topics in the forum on the subject too.

    I don't understand I could write a new function that takes as a parameter a struct with the size as the first member and an array as the second, and I might just do this and do call the regular service, but I was hoping to do more simply.

    The file function C LabVIEW generates for me the COLD Lake when I choose "To adapt to the Type" and "Data in the table pointer", the prototype he expects is:

    int32_t myFunc (handful of uint32_t, uint16_t channel,
    int32_t FIFOnumber, Sub data [], int32_t numWords, int32_t * actualLoaded,.
    int32_t * actualStartIndex);

    And the prototype of the function in my DLL is

    int myFunc borland_dll (DWORD channel, channel of Sina,)
    FIFOnumber int, struct mStruct * data, int, int numWords * actualLoaded, int * actualStartIndex);

    It sounds like a match for me, but it doesn't work (I get garbage in the data).  The topic referenced above LAVA, I realized it would work.  This isn't.

    If I have to cast the data to the pointer-to-pointer I get when I generate c code in my wiring to a CIN struct and by generating, then I seem to get what I expect. But it seems to work when I choose "pointers to handles" too, and I'm expecting data table pointer to give a different result.

    Is it possible to get it works directly, or I have to create a wrapper?  (I am currently using LabVIEW 2011, but we have customers using 2009 and 2012, if not other versions as well).

    Thank you.

    Batya


  • How to deselect a row of table selected on the second click/selection

    I want the line table behavior in such a way that if I click on a selected line, and then select no this line.

    Is this possible?  Help, please.

    Adding to the example of the table of the tutorial seems to work ok:

            table.setRowFactory(new Callback, TableRow>() {
                @Override
                public TableRow call(TableView tableView) {
                    final TableRow row = new TableRow<>();
                    row.addEventFilter(MouseEvent.MOUSE_PRESSED, new EventHandler() {
                        @Override
                        public void handle(MouseEvent event) {
                            final int index = row.getIndex();
                            if (index >= 0 && index < table.getItems().size() && table.getSelectionModel().isSelected(index)) {
                                table.getSelectionModel().clearSelection(index);
                                event.consume();
                            }
                        }
                    });
                    return row;
                }
            });
    
  • Select a table returned in the result of the query

    Hi, I'm trying to find a way to query a table name that I'm back to a different query. I am doing this in pure SQL and PL/SQL, if I can.

    Here's the situation. I have a table called FILES, a table called TYPE and an unknown number of different reference tables with different names.

    Each entry in the FILE has a reference to a TYPE id, and each entry type is a varchar that contains the name of a table reference, such as PHOTO_INFORMATION, PDF_INFORMATION or XML_INFORMATION.

    I want to be able to extract the data from the reference table for any data file. So with a file id, I question TYPE to get the name of the reference table (IE, "PHOTO_INFORMATION" back) then the request it is at this table for all of its columns, using the reference id in the FILE table.

    The thing is that I wish it were generic, so that I can just add an entry to AA_TYPE and a new table for this type, and then I can ask her but I want, through the FILE table. The reason is that there are some data that is common for all files, and I would like to that data in one place.

    Here is my paintings, I have two reference tables of the sample to the bottom "AA_FILETYPE1" and "AA_FILETYPE_PHOTO".
    CREATE TABLE  "AA_FILES" 
       (     "FILE_ID" NUMBER, 
         "FILE_NAME" VARCHAR2(4000), 
         "FILE_TYPE" NUMBER, 
         "REFERENCE_ID" NUMBER, 
          CONSTRAINT "AA_TEST_FILE_PK" PRIMARY KEY ("FILE_ID") ENABLE
       )
    /
    
    CREATE TABLE  "AA_TYPE" 
       (     "TYPE_ID" NUMBER NOT NULL ENABLE, 
         "REFERENCE_TABLE" VARCHAR2(4000), 
          CONSTRAINT "AA_TYPE_PK" PRIMARY KEY ("TYPE_ID") ENABLE
       )
    /
    
    CREATE TABLE  "AA_FILETYPE1" 
       (     "REFERENCE_ID" NUMBER, 
         "DATE_MODIFIED" DATE, 
         "SUMMARY" VARCHAR2(4000), 
         "TOTAL_VALUE" NUMBER(5,2), 
          CONSTRAINT "AA_FILETYPE1_PK" PRIMARY KEY ("REFERENCE_ID") ENABLE
       )
    /
    
    CREATE TABLE  "AA_FILETYPE_PHOTO" 
       (     "REFERENCE_ID" NUMBER NOT NULL ENABLE, 
         "DATE_TAKEN" DATE, 
         "CAMERA_NUMBER" VARCHAR2(4000), 
         "WEATHER_CONDITIONS" VARCHAR2(4000), 
         "CONSULTANT_NAME" VARCHAR2(4000), 
          CONSTRAINT "AA_FILETYPE_PHOTO_PK" PRIMARY KEY ("REFERENCE_ID") ENABLE
       )
    /
    Here's an example query I would use:
    select * from (select REFERENCE_TABLE from AA_TYPE where TYPE_ID = AA_FILES.FILE_TYPE) where REFERENCE_ID = AA_FILES.REFERENCE_ID;
    So who withdrew all the columns in the reference given in AA_TYPE table based on an entry in AA_FILES.

    I'm not entirely sure how to do this, or if this is possible even without using PL/SQL.

    I'm open to suggestions on how to achieve what I want with a different design of table, I am a student and I'm not really experienced in database design. (My first design of database class isn't until next year!)

    Thank you very much!

    Hello

    [email protected] wrote:
    Sorry about the confusion about file_id = 3, I meant the insert in the third I've included. I did not indicate the id_fichier in my inserts since it is the main key and it auto increments.

    It is important to post of the CREATE TABLE and INSERT statements that work. All those who want to help you to will want to recreate the problem and test solutions. Also, do not use strings for all entries. If the column is a NUMBER, use a NUMBER in the INSERT statement. If the column is a DATE, use a DATE or a function that returns a DATE.
    So you should post something like:

    insert into AA_FILES(FILE_ID, FILE_NAME, FILE_TYPE, REFERENCE_ID) values (1, 'test-photo-1.jpg',  1,  1);
    insert into AA_FILES(FILE_ID, FILE_NAME, FILE_TYPE, REFERENCE_ID) values (2, 'test-xml-1.jpg',    2,  2);
    insert into AA_FILES(FILE_ID, FILE_NAME, FILE_TYPE, REFERENCE_ID) values (3, 'test-photo-2.jpg',  1,  2);
    -- The value file_type=1 immediately above was not in your original data, but seems to be what you meant.
    
    prompt =====  AA_TYPE Table:  =====
    
    insert into AA_TYPE(TYPE_ID, REFERENCE_TABLE) values (1, 'AA_FILETYPE_PHOTO');
    insert into AA_TYPE(TYPE_ID, REFERENCE_TABLE) values (2, 'AA_FILETYPE1');
    
    prompt =====  AA_FILETYPE1 Table:  =====
    
    insert into AA_FILETYPE1 (REFERENCE_ID, DATE_MODIFIED,                 SUMMARY,                                    TOTAL_VALUE)
           values           (1,           TO_DATE ('01-01-02', 'MM-DD-RR'), 'An XML file that has some information about something', '14');
    
    prompt =====  AA_FILETYPE_PHOTO Table:  =====
    
    insert into AA_FILETYPE_PHOTO (REFERENCE_ID, DATE_TAKEN,                 CAMERA_NUMBER, WEATHER_CONDITIONS, CONSULTANT_NAME)
                    values            (1,          TO_DATE ('01-01-01', 'MM-DD/RR'), 'abc123',      'rainy!',         'John Smith');
    insert into AA_FILETYPE_PHOTO (REFERENCE_ID, DATE_TAKEN,                 CAMERA_NUMBER, WEATHER_CONDITIONS, CONSULTANT_NAME)
                    values            (2,          TO_DATE ('01-01-02', 'MM-DD/RR'), 'def456',      'slightly cloudy',  'Jane Jones');
    commit;
    

    To give you my workplace, I'm applying in Application Express. A user has entered the number '3' the file_id (I'm not worried about the distinction between passing in the id_fichier and the name of the file, I just my application one application or the other).

    Now, run a query that will get related data which table it is stored in. I don't know the name of the table at design time, as that particular file may be of any type (each of which has a different table name). However, with a the file_id, I have a file_type (in aa_files) which refers to an entry in aa_type.

    I see. You could add even add new tables after this query is written. As long as the new table has a column named reference_id, and there is a line for the new table in aa_files, the following query should work.

    >

    select FILE_TYPE
    from AA_FILES
    where FILE_ID = 3
    

    I stored the name of the table, I need to ask for the rest of the data in aa_type at design time, so using the file_type value, I can get the name of reference_table:

    select REFERENCE_TABLE from AA_TYPE where FILE_TYPE = 1
    

    In the sample data, you have validated, Type_de_fichier = 2 on the 3rd row. I've changed that in my example 1 revised data.
    Be very careful that your explanation fits your data. You talk to people who know about your application, and it is very easy for them to be induced in error or confusion.

    Now the '1' is here that the first query would return. I would like to use a subquery to combine these two queries into a single (I think?). This second query would return "AA_FILETYPE_PHOTO", which is the reference table.

    So I have the reference table, which is a name of table to another table in my database. It contains the data that I'm actually looking for. I want it for this particular file (file_id 3), and in aa_files, I have a value of "reference_id", which refers to the respective line in the reference table. File_id 3, the reference_id is 2.

    select * from AA_FILETYPE_PHOTO
    where reference_id = 2
    

    If the above query gets me my final data.

    Now, I've been watching substitution values and bind variables, here's another way to explain what I want:

    Explanation step by step below is very useful. It would be more useful if each step uniquely and gavce movement results given the sample data and an example of setting (3 in this case)

    -- get the file_type from aa_files for the desired file
    EXEC :file_type := (select file_type from aa_files where file_id = 3);
    

    That we will call the step step (a) above.
    Step (a) sets: Type_de_fichier 1 (given my corrected sample data)

    -- get the reference table from aa_types using the file_type
    EXEC :reference_table := (select reference_table from aa_type where type_id = :file_type);
    

    That we will call the step step (b) above.
    (B) sets the stage: reference_table to 'AA_FILETYPE_PHOTO '.

    -- get the reference_id from aa_files for the desired file
    EXEC :reference_id := (select reference_id from aa_files where file_id = 3);
    

    That we will call the step step (c) above.
    (C) sets the stage: reference_id 2

    -- using the reference table and reference id for the desired file, get the rest of the data
    select * from :reference_table where reference_id = :reference_id;
    

    Not sure if this makes it more clear or not.

    Yes, it helps a lot.

    Basically I have a table full of table names. How do I write a query that pulls one of these table names and it then queries?

    You need SQL dynamic, because you can't hardcode a table name in the query that you normally would be.
    How dynamic SQL works normally (and the functioning of this example) are that the query is built by using a variable. In SQL * more (as shown below), you can simply use a variable substitution instead an identifier hardcoded, and that's what it takes to make the dynamic query from SQL * more resolves the substitution variables before sending the code for the compiler. I don't know much on the Apex, but I bet there's some way to do dynamic SQL in the Apex, too.
    So the dynamic part here should include step d, since you can't hardcode the name of the table in the query.
    Until we can step (d), then, did they to us to do the steps (a) and (b) to obtain this file name. In the example blelow, I used a separate, preliminary request to get the & table_name...
    Step (c) could be made in the main query, using a subquery or a join. However, I chose to step (c) in the preliminary motion, as well as steps (a) and (b), since it's the same table same step (a). In this way, step (d) must refer to a table.

    Here's (finally) how to make this work in SQL * more:

    ACCEPT     file_id     PROMPT     "Enter the file_id (a number, e.g. 3): "
    
    -- Preliminary Query, to set table_name
    
    COLUMN     reference_id_col     NEW_VALUE     reference_id
    COLUMN     table_name_col           NEW_VALUE     table_name
    
    SELECT  f.reference_id          AS reference_id_col
    ,     t.reference_table       AS table_name_col
    FROM      aa_files     f
    JOIN     aa_type          t     ON     f.file_type     = t.type_id
    WHERE     f.file_id     = &file_id
    ;
    
    --     Main Query
    
    SELECT  *
    FROM     &table_name
    WHERE      reference_id     = &reference_id
    ;
    

    The results, account required to the data from the sample I posted above, and the & file_id 3, are:

    `                      CAMERA_    WEATHER_        CONSULTANT_
    REFERENCE_ID DATE_TAKE NUMBER     CONDITIONS      NAME
    ------------ --------- ---------- --------------- ---------------
               2 01-JAN-02 def456     slightly cloudy Jane Jones
    
  • 2015 CC Dreamweaver shows why not the border of the table. In the prevoios version Dreamweaver CS6 see the border of the table.

    2015 CC Dreamweaver shows why not the border of the table. In the previous version of Dreamweaver CC see the border of the table.

    See the difference

    Dreamweaver CC 2015

    Dreamweaver CS6

    The first image shows 'Live' display, as the second watch design mode. That's what I think "Design" shows in the latest version of DW.

  • Extract a specific node of XMLTYPE value

    I have a piece of code that puts an answer Google geocoding in an XMLTYPe variable.  I then use lines similar to the following to retrieve values such as address and location:

    px_xml.EXTRACT('/GeocodeResponse[1]/result['||pn_result_number||']/formatted_address[1]/text()').getstringval();
    

    It's a pretty lazy way of just looping through my results and picking a specific value.

    Now, I need to extract just the addresses zip_code of XML component and can't do in the same way.  Someone at - it ideas?

    A call to the example is:

    https://maps.googleapis.com/maps/API/geocode/XML?address=London+Eye & Bounds = 49.90878, - 7.69042. 60.88770,-0.83496 & key =

    but you need to add your own key to operate.  There are several components of the address and I just want to identify who has the type "zip_code".

    Thank you!

    It's a pretty lazy way of just looping through my results and picking a specific value.

    And what about using a more friendly approach, XMLTABLE namely:

    Extract data from complex XML of XMLType with nodes parents containing several internal nodes

    Use an XPath predicate to target only the required component, for example:

    select x.long_name
    from xmltable('/GeocodeResponse/result'
           passing px_xml
           columns
             long_name   varchar2(200) path 'address_component[type="postal_code"]/long_name'
         ) x
    ;
    
  • Charger xml with sql loader in an xmltype table and show that contain it this XML table

    Hello

    I have a xml document and I want to load in an xmltype table.

    create table foo as xmltype;


    the control file is:


    LOAD DATA
    INFILE
    *
    INTO TABLE foo
    TRUNCATE
    XMLType(XMLDATA)(
    lobfn FILLER CHAR TERMINATED BY
    ',',
    XMLDATA LOBFILE
    (lobfn) TERMINATED BY EOF
    )
    BEGINDATA
    C
    :\Users\xxx\Desktop\file.xml


    now, I want to show the content of the xml file that is loaded at the time of table. How do you?


    select * from foo;   ??


    but this does not show the content of this xml file, but only total, this xml code.



    Thank you

    Hello

    Try to take a look at the Oracle XML SQL functions:

    http://docs.Oracle.com/CD/B28359_01/AppDev.111/b28369/xdb04cre.htm

  • How to create indexes on the ordered collection of XMLTYPE table?

    I use Oracle 11.2.0.2.

    Basically, my XML documents have a 3-level hierarchy:

    event

    + - action [1: n]

    + - param [1: n]

    I try to create indexes on the tables of the orderly collection, but cannot get the right syntax...

    I created a table with an XMLType object-relational column:

    CREATE TABLE T_C_RMP_MNTRNG_XML_FULL_IL4 (
      MESSAGE_ID NUMBER(22,0) NOT NULL ENABLE,
      XML_EVAL_ID NUMBER(22,0),
      VIN7 VARCHAR2(7 BYTE),
      FLEET_ID VARCHAR2(50 BYTE),
      CSC_SW_VERSION VARCHAR2(100 BYTE),
      RECEIVED DATE,
      XML_CONTENT SYS.XMLTYPE ,
      DWH_LM_TS_UTC DATE NOT NULL ENABLE,
      CONSTRAINT PK_C_RMP_MNTRNG_XML_FULL_IL4 PRIMARY KEY (MESSAGE_ID)
    ) NOLOGGING TABLESPACE CATALOG
    VARRAY "XML_CONTENT"."XMLDATA"."action" STORE AS TABLE "T_OR_MON_ACTION" (
      NOLOGGING TABLESPACE "CATALOG"
      VARRAY "param" STORE AS TABLE "T_OR_MON_ACTION_PARAM" (
      NOLOGGING TABLESPACE "CATALOG"
      ) RETURN AS LOCATOR
    ) RETURN AS LOCATOR
    XMLTYPE XML_CONTENT STORE AS OBJECT RELATIONAL XMLSCHEMA "http://mydomain.com/cs.xsd" ELEMENT "monitoring";
    
    
    
    
    

    I execute the SELECT statement:

    SELECT EVENT_ID, ACTION_SUB_ID, MESSAGE_ID, ACTION_TYPE, UNIXTS_TO_DATE(ACTION_TIMESTAMP) ACTION_TIMESTAMP
    FROM T_C_RMP_MNTRNG_XML_FULL_IL4, 
    XMLTABLE( 
      'for $i1 in /monitoring , 
      $i2 in $i1/action            
      return element r {              
      $i1/eventId,              
      $i2            
      }' 
      PASSING XML_CONTENT COLUMNS 
      EVENT_ID VARCHAR(40) PATH 'eventId', 
      ACTION_SUB_ID INTEGER PATH 'action/actionSubId', 
      ACTION_TYPE VARCHAR2(100) PATH 'action/type', 
      ACTION_TIMESTAMP NUMBER(13,0) PATH 'action/time' 
    ) T2 
    WHERE ( 
      EVENT_ID IS NOT NULL AND ACTION_SUB_ID IS NOT NULL 
    )
    
    
    
    
    

    The plan of the explain command looks like this (sorry, don't know how to get it formatted any 'eye-team'):

    ----------------------------------------------------------------------------------------------------------

    | ID | Operation | Name                        | Lines | Bytes | TempSpc | Cost (% CPU). Time |

    ----------------------------------------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |                             |  1609K |  6316M |       |  6110K (1) | 20:22:11 |

    |*  1 |  HASH JOIN |                             |  1609K |  6316M |   111 M |  6110K (1) | 20:22:11 |

    |   2.   TABLE ACCESS FULL | T_C_RMP_MNTRNG_XML_FULL_IL4 |   582K |   104 M |       |  5241 (1) | 00:01:03 |

    |*  3 |   TABLE ACCESS FULL | T_OR_MON_ACTION |    32 M |   117G |       |   105K (2) | 00:21:08 |

    ----------------------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    1 - access ("NESTED_TABLE_ID"= "T_C_RMP_MNTRNG_XML_FULL_IL4"." ("SYS_NC0001300014$")

    filter (CAST (SYS_XQ_UPKXML2SQL (SYS_XQEXVAL (SYS_XQEXTRACT ((SYS_XMLGEN ("T_C_RMP_MNTRN XMLCONCAT

    G_XML_FULL_IL4 ". "" $ SYS_NC00017 ", NULL, SYS_XMLCONV ("T_C_RMP_MNTRNG_XML_FULL_IL4". "SYS_NC00012$", 0.32,

    (('EC1EEF23FD023A27E04032A06D930A8D', 3, 3783, 1)), SYS_MAKEXML ('EC1EEF23FD023A27E04032A06D930A8D', 3780,

    'T_C_RMP_MNTRNG_XML_FULL_IL4 '. "' SYS_NC00008$ ', 'SYS_ALIAS_0 '. ((("' SYS_NC_ROWINFO$ ')),'/ ID ', NULL), 0,.

    0,20971520,0), 50.1, 2) AS VARCHAR (40)) IS NOT NULL)

    3 filter (CAST (TO_NUMBER (TO_CHAR ("SYS_ALIAS_0". "actionSubId")) AS INTEGER) IS NOT NULL) "

    Note

    -----

    -dynamic sample used for this survey (level = 2)

    -Construction detected no optimized XML (activate XMLOptimizationCheck for more information)

    The XML schema looks like this:

    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xmlns:oraxdb="http://xmlns.oracle.com/xdb" oraxdb:storeVarrayAsTable="true" oraxdb:flags="2105639" oraxdb:schemaURL="http://mydomain.com/cs.xsd" oraxdb:schemaOwner="MYUSER" oraxdb:numProps="23">
      <xs:element name="monitoring" oraxdb:propNumber="3785" oraxdb:global="true" oraxdb:SQLName="monitoring" oraxdb:SQLType="monitoring755_T" oraxdb:SQLSchema="MYUSER" oraxdb:memType="258" oraxdb:defaultTable="monitoring757_TAB" oraxdb:defaultTableSchema="MYUSER">
        <xs:complexType oraxdb:SQLType="monitoring755_T" oraxdb:SQLSchema="MYUSER">
          <xs:sequence>
            <xs:element maxOccurs="unbounded" ref="action" oraxdb:propNumber="3780" oraxdb:global="false" oraxdb:SQLName="action" oraxdb:SQLType="action752_T" oraxdb:SQLSchema="MYUSER" oraxdb:memType="258" oraxdb:MemInline="false" oraxdb:SQLInline="true" oraxdb:JavaInline="false" oraxdb:SQLCollType="action756_COLL" oraxdb:SQLCollSchema="MYUSER"/>
            <xs:element ref="reservationType" oraxdb:propNumber="3781" oraxdb:global="false" oraxdb:SQLName="reservationType" oraxdb:SQLType="VARCHAR2" oraxdb:memType="1" oraxdb:MemInline="false" oraxdb:SQLInline="true" oraxdb:JavaInline="false"/>
            <xs:element ref="softwareVersion" oraxdb:propNumber="3782" oraxdb:global="false" oraxdb:SQLName="softwareVersion" oraxdb:SQLType="VARCHAR2" oraxdb:memType="1" oraxdb:MemInline="false" oraxdb:SQLInline="true" oraxdb:JavaInline="false"/>
            <xs:element ref="eventId" oraxdb:propNumber="3783" oraxdb:global="false" oraxdb:SQLName="eventId" oraxdb:SQLType="VARCHAR2" oraxdb:memType="1" oraxdb:MemInline="false" oraxdb:SQLInline="true" oraxdb:JavaInline="false"/>
            <xs:element ref="vin" oraxdb:propNumber="3784" oraxdb:global="false" oraxdb:SQLName="vin" oraxdb:SQLType="VARCHAR2" oraxdb:memType="1" oraxdb:MemInline="false" oraxdb:SQLInline="true" oraxdb:JavaInline="false"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="action" oraxdb:propNumber="3790" oraxdb:global="true" oraxdb:SQLName="action" oraxdb:SQLType="action752_T" oraxdb:SQLSchema="MYUSER" oraxdb:memType="258" oraxdb:defaultTable="action754_TAB" oraxdb:defaultTableSchema="MYUSER">
        <xs:complexType oraxdb:SQLType="action752_T" oraxdb:SQLSchema="MYUSER">
          <xs:sequence>
            <xs:element ref="type" oraxdb:propNumber="3786" oraxdb:global="false" oraxdb:SQLName="type" oraxdb:SQLType="VARCHAR2" oraxdb:memType="1" oraxdb:MemInline="false" oraxdb:SQLInline="true" oraxdb:JavaInline="false"/>
            <xs:element maxOccurs="unbounded" ref="param" oraxdb:propNumber="3787" oraxdb:global="false" oraxdb:SQLName="param" oraxdb:SQLType="param749_T" oraxdb:SQLSchema="MYUSER" oraxdb:memType="258" oraxdb:MemInline="false" oraxdb:SQLInline="true" oraxdb:JavaInline="false" oraxdb:SQLCollType="param753_COLL" oraxdb:SQLCollSchema="MYUSER"/>
            <xs:element ref="actionSubId" oraxdb:propNumber="3788" oraxdb:global="false" oraxdb:SQLName="actionSubId" oraxdb:SQLType="NUMBER" oraxdb:memType="2" oraxdb:MemInline="false" oraxdb:SQLInline="true" oraxdb:JavaInline="false"/>
            <xs:element ref="time" oraxdb:propNumber="3789" oraxdb:global="false" oraxdb:SQLName="time" oraxdb:SQLType="NUMBER" oraxdb:memType="2" oraxdb:MemInline="false" oraxdb:SQLInline="true" oraxdb:JavaInline="false"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="type" type="xs:string" oraxdb:propNumber="3791" oraxdb:global="true" oraxdb:SQLName="type" oraxdb:SQLType="VARCHAR2" oraxdb:memType="1" oraxdb:defaultTable="type751_TAB" oraxdb:defaultTableSchema="MYUSER"/>
      <xs:element name="param" oraxdb:propNumber="3794" oraxdb:global="true" oraxdb:SQLName="param" oraxdb:SQLType="param749_T" oraxdb:SQLSchema="MYUSER" oraxdb:memType="258" oraxdb:defaultTable="param750_TAB" oraxdb:defaultTableSchema="MYUSER">
        <xs:complexType oraxdb:SQLType="param749_T" oraxdb:SQLSchema="MYUSER">
          <xs:sequence>
            <xs:element minOccurs="0" ref="value" oraxdb:propNumber="3792" oraxdb:global="false" oraxdb:SQLName="value" oraxdb:SQLType="VARCHAR2" oraxdb:memType="1" oraxdb:MemInline="false" oraxdb:SQLInline="true" oraxdb:JavaInline="false"/>
            <xs:element ref="key" oraxdb:propNumber="3793" oraxdb:global="false" oraxdb:SQLName="key" oraxdb:SQLType="VARCHAR2" oraxdb:memType="1" oraxdb:MemInline="false" oraxdb:SQLInline="true" oraxdb:JavaInline="false"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="value" type="xs:string" oraxdb:propNumber="3795" oraxdb:global="true" oraxdb:SQLName="value" oraxdb:SQLType="VARCHAR2" oraxdb:memType="1" oraxdb:defaultTable="value748_TAB" oraxdb:defaultTableSchema="MYUSER"/>
      <xs:element name="key" type="xs:string" oraxdb:propNumber="3796" oraxdb:global="true" oraxdb:SQLName="key" oraxdb:SQLType="VARCHAR2" oraxdb:memType="1" oraxdb:defaultTable="key747_TAB" oraxdb:defaultTableSchema="MYUSER"/>
      <xs:element name="actionSubId" type="xs:integer" oraxdb:propNumber="3797" oraxdb:global="true" oraxdb:SQLName="actionSubId" oraxdb:SQLType="NUMBER" oraxdb:memType="2" oraxdb:defaultTable="actionSubId746_TAB" oraxdb:defaultTableSchema="MYUSER"/>
      <xs:element name="time" type="xs:integer" oraxdb:propNumber="3798" oraxdb:global="true" oraxdb:SQLName="time" oraxdb:SQLType="NUMBER" oraxdb:memType="2" oraxdb:defaultTable="time745_TAB" oraxdb:defaultTableSchema="MYUSER"/>
      <xs:element name="reservationType" type="xs:string" oraxdb:propNumber="3799" oraxdb:global="true" oraxdb:SQLName="reservationType" oraxdb:SQLType="VARCHAR2" oraxdb:memType="1" oraxdb:defaultTable="reservationType744_TAB" oraxdb:defaultTableSchema="MYUSER"/>
      <xs:element name="softwareVersion" type="xs:string" oraxdb:propNumber="3800" oraxdb:global="true" oraxdb:SQLName="softwareVersion" oraxdb:SQLType="VARCHAR2" oraxdb:memType="1" oraxdb:defaultTable="softwareVersion743_TAB" oraxdb:defaultTableSchema="MYUSER"/>
      <xs:element name="eventId" type="xs:string" oraxdb:propNumber="3801" oraxdb:global="true" oraxdb:SQLName="eventId" oraxdb:SQLType="VARCHAR2" oraxdb:memType="1" oraxdb:defaultTable="eventId742_TAB" oraxdb:defaultTableSchema="MYUSER"/>
      <xs:element name="vin" type="xs:string" oraxdb:propNumber="3802" oraxdb:global="true" oraxdb:SQLName="vin" oraxdb:SQLType="VARCHAR2" oraxdb:memType="1" oraxdb:defaultTable="vin741_TAB" oraxdb:defaultTableSchema="MYUSER"/>
    </xs:schema>
    
    
    
    
    

    How can I create an index on these tables of the ordered collection to improve performance?

    I found the example at http://docs.Oracle.com/CD/E11882_01/AppDev.112/e23094/xdb_rewrite.htm#ADXDB5859 but am not able to apply to this particular case...

    Thank you in advance...

    If the schema is not annotated and XS: Integer and XS: String are mapped to types of data NUMBER and VARCHAR2 (4000), so you must use in your query to avoid typecasting unnecessary operations.

    You must also use XMLTABLEs chained when accessing a parent/child instead of a FLWOR expression relationship, otherwise the CBO cannot rewrite the XQuery query correctly (maybe it's fixed in the latest version).

    If you make these changes, the plan should show the cleaner predicates:

    SQL > SELECT EVENT_ID, MESSAGE_ID, ACTION_TYPE, ACTION_SUB_ID, ACTION_TIMESTAMP

    2 FROM test_table

    3 XMLTABLE ('/ monitoring ')

    4 COLUMNS XML_CONTENT OF PASSAGE

    5 WAY of VARCHAR2 (4000) EVENT_ID "ID."

    6 actions for XMLTYPE PATH 'action '.

    (7) T1,

    8 XMLTABLE ('/ action')

    Shares of PASSAGE 9 COLUMNS

    NUMBER of ACTION_SUB_ID 10 PATH "actionSubId."

    11 PATH of VARCHAR2 (4000) ACTION_TYPE "type."

    12 WAY of NUMBER ACTION_TIMESTAMP 'time '.

    (13) T2

    14 WHERE EVENT_ID IS NOT NULL

    15 AND ACTION_SUB_ID IS NOT NULL

    16;

    Execution plan

    ----------------------------------------------------------

    Hash value of plan: 1763884463

    ------------------------------------------------------------------------------------------------

    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |

    ------------------------------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |                 |   109.   220K |     6 (17). 00:00:01 |

    |   1.  THE MERGE JOIN.                 |   109.   220K |     6 (17). 00:00:01 |

    |*  2 |   TABLE ACCESS BY INDEX ROWID | TEST_TABLE |    11.   352.     2 (0) | 00:00:01 |

    |   3.    INDEX SCAN FULL | SYS_C007567 |    11.       |     1 (0) | 00:00:01 |

    |*  4 |   JOIN TYPE.                 |   109.   216K |     4 (25) | 00:00:01 |

    |*  5 |    TABLE ACCESS FULL | T_OR_MON_ACTION |   106 S 216K |     3 (0) | 00:00:01 |

    ------------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    2 - filter("TEST_TABLE".") (' SYS_NC00012$ ' IS NOT NULL)

    4 - access("SYS_ALIAS_0".") NESTED_TABLE_ID "=" TABLE_TEST. " ("' SYS_NC0000800009$ ')

    filter ("SYS_ALIAS_0". "NESTED_TABLE_ID"="TABLE_TEST" "." " ("SYS_NC0000800009$")

    5 - filter("SYS_ALIAS_0"." actionSubId» IS NOT NULL)

    Note

    -----

    -dynamic sample used for this survey (level = 2)

    Now, if it is still necessary, everything boils down to choosing a technique for index NULL values:

    -composite index with a column not zero or constant

    -FBI

    -bitmap image

    Choose the one that best fits your data, the selectivity and activity on the tables.

  • Object Table of XMLType vs single column of XMLType Table

    What are the differences between the XMLType table object and a table with a single column of XMLType?

    It's

    CREATE TABLE XMLType xml_table;

    and

    CREATE TABLE xml_table (xml_field XMLTYPE);

    That should be used and when? Both may be declared to be aware of schema.

    The main difference is that an XMLType object array allows the use of the XML DB Repository to store and retrieve XML content.
    The relationship between a resource and its content is maintained by a "pointer" (REF XMLType) line in the XMLType table:

    http://docs.Oracle.com/CD/E11882_01/AppDev.112/e23094/xdb03usg.htm#ADXDB4223
    http://docs.Oracle.com/CD/E11882_01/AppDev.112/e23094/xdb03usg.htm#BJFBDEJE

    Tables based on the patterns of XMLType (including the associated nested structure) can also be created automatically through recording scheme, which is very convenient when the pattern becomes complex.
    In addition, a registred schema-compliant documents that go into the repository automatically stored in the table by default (see the annotation xdb:defaultTable).
    We can also use ACLs to control access to specific rows in a table of object XMLType.

    This is not possible with XMLType columns in a relational table.

  • How to remove an xmltype table .xml file?

    Hi expert,

    I'm in I'm in Oracle Enterprise Manager 11 g 11.2.0.1.0.
    SQL * more: Production of release 11.2.0.1.0 killed him Feb 22 11:40:23 2011

    I inserted 3 .xml files in an xmltype table: DOCUMENT

    SQL > SELECT OBJECT_VALUE FROM document;

    OBJECT_VALUE
    -----------------------------------------------------------------------
    <? XML version = "1.0" encoding = "WINDOWS-1252"? >
    <? XML-stylesheet href = "http://www.accessdata.fda.gov/spl/stylesheet/spl.xsl" type = "text/xsl"? >
    < document xmlns = "" urn: hl7 - org:v3 "xmlns: xsi ="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLoc"
    action = "" urn: hl7 - org:v3 http://localhost:8080/home/DEV/xsd/spl.xsd ' classCode 'DOC' = > "
    < root id = "5ca4e3cb-7298-4948-8cc2-58e71ad32694" / >
    < code = c '51725-0.

    <? XML version = "1.0" encoding = "WINDOWS-1252"? >
    <? XML-stylesheet href = "http://www.accessdata.fda.gov/spl/stylesheet/spl.xsl" type = "text/xsl"? >
    < document xmlns = "" urn: hl7 - org:v3 "xmlns: xsi ="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLoc"
    action = "" urn: hl7 - org:v3 http://localhost:8080/home/DEV/xsd/spl.xsd ' classCode 'DOC' = > "
    < root id = "03d6a2cd-fdda-4fe1-865d-da0db9212f34" / >
    < code = c '51725-0.

    <? XML version = "1.0" encoding = "WINDOWS-1252"? >
    <? XML-stylesheet href = "http://www.accessdata.fda.gov/spl/stylesheet/spl.xsl" type = "text/xsl"? >
    < document xmlns = "" urn: hl7 - org:v3 "xmlns: xsi ="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLoc"
    action = "" urn: hl7 - org:v3 http://localhost:8080/home/DEV/xsd/spl.xsd ' classCode 'DOC' = > "
    < root id = "09ff06d6-8b85-43dd-b5cc-e22d00f02bd0" / >
    < code = c '51725-0.

    I tried to remove an xml file which with root id = "03d6a2cd-fdda-4fe1-865d-da0db9212f34'"

    delete the document
    where xmlexists (' $p/document/id [@root = "03d6a2cd-fdda-4fe1-865d-da0db9212f34"]' in PASSING OBJECT_VALUE AS "p");

    but failed.
    Y at - it that can help any expert?

    Thank you very much!

    Cow

    Published by: cow on March 11, 2011 19:02

    Hello

    Namespace problem.
    You must declare it in the XQuery Prolog:

    DELETE FROM document
    WHERE XMLExists( 'declare default element namespace "urn:hl7-org:v3"; (::)
                      $p/document/id[@root=$root_value]'
                     passing object_value as "p",
                             '03d6a2cd-fdda-4fe1-865d-da0db9212f34' as "root_value" )
    ;
    
  • Retriving the XMLData of an XMLtype table

    Hello
    I create a table xmltype and xml insertion in the table.
    1. create the test_tab of xmlschema xmltype table ' / public/config.xsd ""Configuration"element
    2. Insert in test_tab values('<Config)
    xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance".
    xsi:noNamespaceSchemaLocation="/public/config.xsd" >
    < ApsConfig >
    < TcpInterfaceConfig >
    < mode > CONNECT < / Mode >
    < port > 28496 < / Port >
    < / TcpInterfaceConfig >
    < / ApsConfig >
    (< / Config > ');
    How to recover the above the line inserted into a new XML file?
    If I used the dbms_xmlgen() to get the xml file, its appears does not correctly.
    Please help me.
    Thanks in advance...

    Published by: jagdish1206 on March 24, 2010 03:41
    select xmldoc from test_xml where name = 'config1';
    

    will return only the XML stored this line

    How to store the return value

    What store? XML is already in the DB. If you talk to store in your C++ program, I won't be able to help you as I have no experience there.

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

    Hi all

    Still trying to get my mind on all that XML stuff.

    Can someone explain briefly the difference between:
    create table this_is_xmltype_tab of xmltype;
    and
    create table this_is_tab_w_xmltpe_col(id number, document xmltype);
    What are the advantages and disadvantages of each solution? How are they really different?

    Thank you

    -Mark

    Sorry Mark, as far as I know it is not a real difference despite the fact that you can use the table with the column (ID), probably more effective for document-focused while driving the query via the ID column and anything else I can think off automatically about XMLType contra XMLType table columns is that (as far as I KNOW) you can not use a column of XMLType to shred the data into it via WebDAV o FTP. But then again I never really tried to do an XMLType column-based. Alternatives, for example, a binary XML column begins with a column of $ sys_nc_oid which is indexed, so in principle you shouldn't need an ID (number) column that has an index (a read also on http://www.liberidu.com/blog/?p=494). If there has been non-null that you could use this index for document oriented applications.

  • Select all the elements with the same name of XMLTYPE

    Hello

    I have the following xml code stored in the XMLTYPE column:

    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Created with Jaspersoft Studio version 6.2.0.final using JasperReports Library version 6.2.0  -->
    <!-- 2016-01-02T23:09:52 -->
    <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Blank_A4" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="8f749217-51eb-4c79-9b11-5a3e11b5b1b4">
        <property name="com.jaspersoft.studio.data.sql.tables" value=""/>
        <property name="com.jaspersoft.studio.data.defaultdataadapter" value="MyXE_ssh"/>
        <queryString>
            <![CDATA[select * from dept where deptno=10]]>
        </queryString>
        <field name="DEPTNO" class="java.math.BigDecimal"/>
        <field name="DNAME" class="java.lang.String"/>
        <background>
            <band splitType="Stretch"/>
        </background>
        <title>
            <band height="221" splitType="Stretch">
                <staticText>
                    <reportElement x="7" y="2" width="100" height="30" uuid="2bc03b83-e484-46e5-8681-48a9b01ac437"/>
                    <text><![CDATA[DEPTNO]]></text>
                </staticText>
                <staticText>
                    <reportElement x="160" y="2" width="100" height="30" uuid="3dfc25f3-6ff1-4186-8ee6-c71759a749a7"/>
                    <text><![CDATA[DNAME]]></text>
                </staticText>
                <subreport>
                    <reportElement x="10" y="60" width="544" height="20" uuid="e947974e-27bc-4b90-b0ee-f709b969c91b"/>
                    <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
                    <subreportExpression><![CDATA["subreport.jasper"]]></subreportExpression>
                </subreport>
            </band>
        </title>
        <pageHeader>
            <band height="73" splitType="Stretch"/>
        </pageHeader>
        <columnHeader>
            <band height="36" splitType="Stretch"/>
        </columnHeader>
        <detail>
            <band height="35" splitType="Stretch"/>
        </detail>
        <columnFooter>
            <band height="45" splitType="Stretch"/>
        </columnFooter>
        <pageFooter>
            <band height="54" splitType="Stretch"/>
        </pageFooter>
        <summary>
            <band height="44" splitType="Stretch">
                <subreport>
                    <reportElement x="130" y="10" width="200" height="34" uuid="892a1adf-f7e7-4804-8f7f-a5227516afb5"/>
                    <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
                    <subreportExpression><![CDATA["rep1/subrep2.jasper"]]></subreportExpression>
                </subreport>
            </band>
        </summary>
    </jasperReport>
    

    Please, is it possible to select all < subreport > items, so the result of a query would be something like:

    <subreport>
                    <reportElement x="10" y="60" width="544" height="20" uuid="e947974e-27bc-4b90-b0ee-f709b969c91b"/>
                    <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
                    <subreportExpression><![CDATA["subreport.jasper"]]></subreportExpression>
     </subreport>
     <subreport>
                    <reportElement x="130" y="10" width="200" height="34" uuid="892a1adf-f7e7-4804-8f7f-a5227516afb5"/>
                    <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
                    <subreportExpression><![CDATA["rep1/subrep2.jasper"]]></subreportExpression>
    </subreport>
    

    The problem is this subreport sections can be nested more or less anywhere, so I do not know the path. Any suggestions would be much appreciated.

    Thank you

    Pavel

    The XPath ' / /' means selects nodes in the document from the current node that match the selection, regardless of where they are.  If the XPath ' / / the subreport ' will extract all nodes called subreport wherever they are in the document or not.  So something like...

    data (donnees_xml))

    Select xmltype)

    '

    "http://JasperReports.sourceforge.net/JasperReports" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" "xsi: schemaLocation ="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd"name ="Blank_A4"pageWidth ="595"pageHeight = columnWidth"842"="555"leftMargin ="20"rightMargin ="20"topMargin ="20"bottomMargin ="20"uuid ="8f749217-51eb-4c79-9b11-5a3e11b5b1b4">

    <p class="reply"> <p class="reply"><band height="221" splittype="Stretch"><p class="reply"> <p class="reply"><staticText><p class="reply"> <p class="reply"><reportElement x="7" y="2" width="100" height="30" uuid="2bc03b83-e484-46e5-8681-48a9b01ac437"></reportElement></p> <p class="reply"><text><![CDATA[DEPTNO]]></text></p> <p class="reply"></staticText></p> <p class="reply"><staticText><p class="reply"> <p class="reply"><reportElement x="160" y="2" width="100" height="30" uuid="3dfc25f3-6ff1-4186-8ee6-c71759a749a7"></reportElement></p> <p class="reply"><text><![CDATA[DNAME]]></text></p> <p class="reply"></staticText></p> <p class="reply"><subreport><p class="reply"> <p class="reply"><reportElement x="10" y="60" width="544" height="20" uuid="e947974e-27bc-4b90-b0ee-f709b969c91b"></reportElement></p> <p class="reply"><connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression></p> <p class="reply"><subreportExpression><![CDATA["subreport.jasper"]]></subreportExpression></p> <p class="reply"></subreport></p> <p class="reply"></band></p> <p class="reply">

    the double)

    Select *.

    from xmltable (XMLNamespaces (DEFAULT 'http://jasperreports.sourceforge.net/jasperreports'),

    ' / / the subreport '

    passage (select donnees_xml data)

    columns

    xmltype subreport path '.')

    SUBREPORT

    http://JasperReports.sourceforge.NET/JasperReports">

    http://JasperReports.sourceforge.NET/JasperReports">

    2 selected lines.

Maybe you are looking for