How to add a xmlelements not nested in a nested query xmlelement

I have the following query prints in a file xml very well:

Select xmlroot)
XmlElement
(
EMSData,
XMLAGG
(

XMLELEMENT
(
year,
XmlAttributes (calyear),
XMLAGG
(
XmlElement
(
meantime,
XmlAttributes (intervalType as 'Type', 'Value' ValeurIntervalle),
XmlElement
(
data,
XmlAttributes (selectType as "Select", supplier, mission, instrument),
XMLFOREST
(
bytes,
files
)
)
)
ValeurIntervalle desc order, supplier, mission, orderBy, instrument
)
)
calyear desc order
)
(), version '1.0') .getClobVal () in l_xml
FROM MyTable
Calyear group;

The output is:
<? XML version = "1.0"? >
< EMSDATA >
< CALYEAR YEAR = "2011" >
< Type INTERVAL = 'DAY' Value = "320" >
< Select DATA = 'SYSTEM' >
< BYTES > 2750877820501 < / BYTES >
<>273997 FILES < / FILES >
< / DATA >
< / INTERVAL >
< Type INTERVAL = 'DAY' Value = '319' >
< Select DATA = 'SYSTEM' >
< BYTES > 5155961487454 < / BYTES >
<>378457 FILES < / FILES >
< / DATA >
< / INTERVAL >
< Type INTERVAL = 'DAY' Value = "318" >
< Select DATA = 'SYSTEM' >
< BYTES > 4606818769422 < / BYTES >
<>420231 FILES < / FILES >
< / DATA >
< / INTERVAL >
< Type INTERVAL = 'DAY' Value = "317" >
< Select DATA = 'SYSTEM' >
< BYTES > 3686199358862 < / BYTES >
<>399271 FILES < / FILES >
< / DATA >
< / INTERVAL >
< Type INTERVAL = 'DAY' Value = '316' >
< Select DATA = 'SYSTEM' >
< BYTES > 4989867970498 < / BYTES >
<>406249 FILES < / FILES >
< / DATA >
< / INTERVAL >
< Type INTERVAL = 'DAY' Value = "315" >
< Select DATA = 'SYSTEM' >
< BYTES > 4027315556027 < / BYTES >
<>463319 FILES < / FILES >
< / DATA >
< / INTERVAL >
< Type INTERVAL = 'DAY' Value = "314" >
< Select DATA = 'SYSTEM' >
< BYTES > 4893244762669 < / BYTES >
<>600252 FILES < / FILES >
< / DATA >
< / INTERVAL >
< / YEAR >
< / EMSDATA >

What I have to do is to add a few items just above the nested element under < YEAR >, i.e.:

<? XML version = "1.0"? >
< EMSDATA >
< DailyStartDate > 28 November 11 < / DailyStartDate >
< WeeklyStartDate > 29 - SEP - 11 < / WeeklyStartDate >
< MonthlyStartDate > 1 October 01 < / MonthlyStartDate >
< CALYEAR YEAR = "2011" >
< Type INTERVAL = 'DAY' Value = "320" >
< Select DATA = 'SYSTEM' >
< BYTES > 2750877820501 < / BYTES >
<>273997 FILES < / FILES >
< / DATA >
< / INTERVAL >
< Type INTERVAL = 'DAY' Value = '319' >
< Select DATA = 'SYSTEM' >
< BYTES > 5155961487454 < / BYTES >
<>378457 FILES < / FILES >
< / DATA >
< / INTERVAL >
< Type INTERVAL = 'DAY' Value = "318" >
< Select DATA = 'SYSTEM' >
< BYTES > 4606818769422 < / BYTES >
<>420231 FILES < / FILES >
< / DATA >
< / INTERVAL >
< Type INTERVAL = 'DAY' Value = "317" >
< Select DATA = 'SYSTEM' >
< BYTES > 3686199358862 < / BYTES >
<>399271 FILES < / FILES >
< / DATA >
< / INTERVAL >
< Type INTERVAL = 'DAY' Value = '316' >
< Select DATA = 'SYSTEM' >
< BYTES > 4989867970498 < / BYTES >
<>406249 FILES < / FILES >
< / DATA >
< / INTERVAL >
< Type INTERVAL = 'DAY' Value = "315" >
< Select DATA = 'SYSTEM' >
< BYTES > 4027315556027 < / BYTES >
<>463319 FILES < / FILES >
< / DATA >
< / INTERVAL >
< Type INTERVAL = 'DAY' Value = "314" >
< Select DATA = 'SYSTEM' >
< BYTES > 4893244762669 < / BYTES >
<>600252 FILES < / FILES >
< / DATA >
< / INTERVAL >
< / YEAR >
< / EMSDATA >

I can select these separate items of data in the table or I can add them to the XML through a local variable. I tried several ways to add this to my above query but am stuck. If I bring to the table, the field names are dailyStartDate, weeklyStartDate and monthlyStartDate. Again, I only want the distinct values and therefore something for everyone in this XML file rather than enumerate over and over again in the XML.

Please notify.

Best,
NAT

If you already have the values in variables, why not just do that?

select xmlroot(
 xmlelement
 (
  EMSData,
  XMLForest(
   v_DailyStartDate as "DailyStartDate",
   v_WeeklyStartDate as "WeeklyStartDate",
   v_MonthlyStartDate as "MonthlyStartDate"
  ),
  XMLAGG
  (
   XMLELEMENT
   (
    year,

Tags: Database

Similar Questions

  • How to add searchable keywords/notes

    How add searchable notes/tags to my emails incoming and outgoing, who can help me find an e-mail related to a note/keyword specific. Help, please.

    Change the object or any part of the message with one of these modules:

    https://addons.Mozilla.org/en-us/Thunderbird/addon/header-Tools-Lite/

    https://addons.Mozilla.org/en-us/Thunderbird/addon/edit-email-subject/

    http://chrisramsden.vfast.co.UK/3_How_to_install_Add-ons_in_Thunderbird.html

  • How to add an additional note between &lt; ROWSET &gt; and &lt; ROW &gt;

    Hi all

    Is there a way to add an additional NŒUD between < ROWSET > and < ROW > which appears ONCE per each XML document?

    <? XML version = "1.0"? >

    rowset <>

    < ROW >

    < > 7369 EMPNO < / EMPNO >

    SMITH < ENAME > < / ENAME >

    CLERK of < JOB > < / JOB >

    < MGR > 7902 < / MGR >

    < HIREDATE > 17 December 80 < / HIREDATE >

    < > 800 SAL < / SAL >

    < DEPTNO > 20 < / DEPTNO >

    < / ROW >

    < ROW >

    < > 7499 EMPNO < / EMPNO >

    ALLEN < ENAME > < / ENAME >

    SELLER of < JOB > < / JOB >

    < MGR > 7698 < / MGR >

    < HIREDATE > 20 February 81 < / HIREDATE >

    < SAL > 1600 < / SAL >

    < Order > 300 < / COMM >

    < DEPTNO > 30 < / DEPTNO >

    < / ROW >

    ...

    < / LINES >

    Will be

    <? XML version = "1.0"? >

    rowset <>

    new <>test < / test >

    < ROW >

    < > 7369 EMPNO < / EMPNO >

    SMITH < ENAME > < / ENAME >

    CLERK of < JOB > < / JOB >

    < MGR > 7902 < / MGR >

    < HIREDATE > 17 December 80 < / HIREDATE >

    < > 800 SAL < / SAL >

    < DEPTNO > 20 < / DEPTNO >

    < / ROW >

    < ROW >

    < > 7499 EMPNO < / EMPNO >

    ALLEN < ENAME > < / ENAME >

    SELLER of < JOB > < / JOB >

    < MGR > 7698 < / MGR >

    < HIREDATE > 20 February 81 < / HIREDATE >

    < SAL > 1600 < / SAL >

    < Order > 300 < / COMM >

    < DEPTNO > 30 < / DEPTNO >

    < / ROW >

    ...

    < / LINES >

    Thank you in advance, Sonya

    I don't think it's possible with dbms_xmlgen. I suggest you explore sql/xml to generate your own code xml using the keywords etc. of xmlelement, xmlagg.

    For example:

    Select xmlelement ("LINES"

    , xmlelement ("TEST", "NEW")

    XMLAGG (XMLELEMENT ("ROW",

    XMLFOREST (EMPNO,

    ENAME

    WORK

    BISHOP

    HIREDATE

    SAL

    COMM

    DEPTNO

    ) AS THE FOREST - XMLFOREST

    ) - LINE

    ) - TOT.

    ) - ROWSET

    from EMP;

    you will look like the following:

    New

    7369

    SMITH

    CLERK

    7902

    1980 12-17

    800

    20

    7499

    ALLEN

    SELLER

    7698

    1980-02-20

    1600

    300

    30

  • How to add a FIFO 128-bit DRAM to the FPGA project?

    How can I add the DRAM FIFO - 128-bit memory Interface to an SMU-796XR RIO module?

    Above project is examples of projects. I know how to add DRAM but not how to set as FIFO 128 bits as shown above.

    Any guidance is appreciated.

    Right-click on the FPGA target-> properties

    Select Properties DRAM on the left side of the Popup.

    Change the mode of the two shores to CLIP nested LabVIEW FPGA memories.

    Click OK.

    The project will be auto-updated with new DRAM memory, it will be empty.

    Right-click on the DRAM-> properties

    Enable

    Select FIFO 128 bits

  • How can I add the speaker notes to a slide using applescript?

    How can I add the speaker notes to a slide using applescript? I am able to create slides, add a title and bullet points, but when I try to add the speaker notes, it does not work.

    say thisSlide

    -set the title

    set the text of the object to the default title at "TITLE" element

    -create a bulleted list

    the text of the object of the item to the default body ¬

    "Bullet Point 1" & return & "Bullet Point 2" & return & "Bullet Point 3"»»

    -put the presenter notes

    ¬ the text value of the object of the presenter notes

    '' Here is my presenter notes.

    How can I add the speaker notes to a slide using applescript?

    Maybe like this:

    say thisSlide

    -put the presenter notes

    Set presenter notes to "here is my presenter notes.

    end say

  • try to find how to add timestamp to the notes I put in the section notes to contacts

    try to find how to add a timestamp to the notes I put in the section notes to a contact

    Hello jlaneco,

    Thank you for visiting the Microsoft answers community. The question you have posted is related to Office Outlook and would be better suited to the Community Office Outlook. Please visit the link below to find a community that will provide the support you want.

    http://www.Microsoft.com/Office/Community/en-us/default.mspx?DG=Microsoft.public.Office.misc&lang=en&CR=us

    I myself have sought a solution to this problem and have not found one solution viable, other than having to click Date & time whenever you want to place a stamp in your notes.

    Hope this helps

    Chris.H
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • For a given file, how to add and change file properties on the Details tab, for properties that are not in the properties list?

    Now, I am aware of the modification of the properties of the file is simple in Windows 7 Explorer. Select a file, 'Properties', then tab "Details".  Some are not editable, and that's understandable.  Click on next to any area classified as year, Genre, Publisher, etc. and the apply.  No problems so far.

    Then of course in Explorer, when you right click on a column header, you get several choices of column beyond the usual that is displayed by default; Date, the Type, size, etc.  But, there is an option "More...", which has up to now, MUCH more useful properties to choose from, such as the model project, Department, job statusand so on.

    It's fantastic!

    But when you look into the details of any given file, none of these additional properties even are listed to be edited.  Why offer to view these details, if you don't change them, or add them to different files?  I must be missing something.  I do not need to add my own custom details, this additional list has a choice, that I need; If only I could edit the files to get this info.

    How to add and change these properties to files?  Word, Excel, MP4, AVI, JPG; I would add these properties, so I can set directly in the Solution Explorer, as you would by name or Type.

    Any help would be greatly appreciated!

    My experience is that most of these 'extra fields' no existence not as fields in the directory (folder) itself.  On the contrary, these fields exist in the target file itself. Each file type has its own format and established file except for the types of files that belong to Microsoft, Microsoft cannot control or arbitrarily change the format of a particular file type.

    For example, a ".jpg" file  The format of this file type allows a large number of areas such as comments, Tags, date taken, opening, device manufacturer and so on.  If you go into the properties on a .jpg file, you will see a lot of them and will be able to change.  After changing any of these fields, you will find that the file itself has been changed to contain this information (as can be verified by the parity of the file and to come check upward with a different checksum).  If you display one of these fields in Explorer and 10000 ".jpg" files in this folder, then Explorer must open each of these 10000 files to extract the data in the corresponding fields, you have chosen to display.  May take some time.

    Compare that to the same picture saved to a file ".bmp".  The ".bmp" format has no provisions for any of these fields, so you will not be able to view, save, edit, or sort by them.  If the editable fields are directly related to the type of file that is displayed.

    Microsoft has apparently interviewed a lot of file types and made a compilation of the editable fields in each type of file and the Union of the selected fields in which can be displayed and modified.   That's apparently what you see in the option «More...» ».   So, in summary, the file type determines which fields are available for editing and posting.

    HTH,

    JW

  • How to add a solitary icon on desktop W8 (splash screen not)?

    I use desktop of Windows 8. I do not use the home screen with the tiles. How to add a shortcut icon for Solitaire on the desktop of Windows 8?

    Unfortunately, you are not able to create a modern App shortcuts on the desktop, I understand that it is possible using a "Début8" program, as well as a web search reveals the Registry hacks that are supposed to work.

  • How to add constraints not null

    Data modeling Version 4.1.1.888 SQL

    How to add constraints not null in sql modeling data and rename the default constraint name that is getting generated when marking column as required.

    You can edit the template for the names of constraint not Null under properties-> setting->-> models naming standards. Change one marked 'not forced Null. Then, under preferences-> Data Modeler-> DDL, you must uncheck "generate short form constraint NOT NULL".

  • How to add two lines when the second row is not visible, but also gets the first data line too?

    Mr President

    Jdev worm is 12.2.1

    How to add two lines when the second row is not visible, but also gets the first data line too?

    I want to add two lines like below picture, but want the second to remain invisible.

    tworows.png

    I asked this question but my way of asking was wrong, that's why for me once again.

    Concerning

    Try to follow these steps:

    1. in the database table to add the new column "JOIN_COLUMN" and add the new sequence "JOIN_SEQ".

    2. Add this new column in the entity object. (You can add this in entity object by right clicking on the entity object and then select "Synchronize with database" then the new column and press on sync)

    3. in your bookmark create button to create only one line NOT 2 rows.

    4 - Open the object entity--> java--> java class--> on the entity object class generate and Tick tick on the accessors and methods of data manipulation

    5 - Open the generated class to EntityImpl and go to the doDML method and write this code

      protected void doDML(int operation, TransactionEvent e)
      {
        if(operation == DML_INSERT)
        {
          SequenceImpl seq = new SequenceImpl("JOIN_SEQ", getDBTransaction());
          oracle.jbo.domain.Number seqValue = seq.getSequenceNumber();
          setJoinColumn(seqValue);
          insertSecondRowInDatabase(getAttribute1(), getAttribute2(), getAttribute3(), getJoinColumn());
        }
    
        if(operation == DML_UPDATE)
        {
          updateSecondRowInDatabase(getAttribute1(), getAttribute2(), getAttribute3(), getJoinColumn());
        }
    
        super.doDML(operation, e);
      }
    
      private void insertSecondRowInDatabase(Object value1, Object value2, Object value3, Object joinColumn)
      {
        PreparedStatement stat = null;
        try
        {
          String sql = "Insert into table_name (COLUMN_1,COLUMN_2,COLUMN_3,JOIN_COLUMN, HIDDEN_COLUMN) values ('" + value1 + "','" + value2 + "','" + value3 + "','" + joinColumn + "', 1)";
          stat = getDBTransaction().createPreparedStatement(sql, 1);
          stat.executeUpdate();
        }
        catch (Exception e)
        {
          e.printStackTrace();
        }
        finally
        {
          try
          {
            stat.close();
          }
          catch (Exception e)
          {
            e.printStackTrace();
          }
        }
      }
    
      private void updateSecondRowInDatabase(Object value1, Object value2, Object value3, Object joinColumn)
      {
        PreparedStatement stat = null;
        try
        {
          String sql = "update table_name set column_1='" + value1 + "', column_2='" + value2 + "', column_3='" + value3 + "' where JOIN_COLUMN='" + joinColumn + "'";
          stat = getDBTransaction().createPreparedStatement(sql, 1);
          stat.executeUpdate();
        }
        catch (Exception e)
        {
          e.printStackTrace();
        }
        finally
        {
          try
          {
            stat.close();
          }
          catch (Exception e)
          {
            e.printStackTrace();
          }
        }
      }
    
  • We know why in my Extension Manager is not any product on the left menu? or how to add them?

    We know why in my Extension Manager is not any product on the left menu? or how to add them?Captura de pantalla 2016-02-04 a las 10.20.01 a.m..png

    Adobe Exchange

    Please click the link above for more information.

  • Cannot figure out how to "add-in" for the 2013 Outlook application... said the loading behavior is not loaded. How can I fix it?

    Cannot figure out how to "add-in" for the 2013 Outlook application... said the loading behavior is not loaded. How can I fix it?

    Hi amandab9126792,

    2013 Outlook does not work with Acrobat X because they are not compatible. Please check the compatibility to https://helpx.adobe.com/acrobat/kb/compatible-web-browsers-pdfmaker-applications.html.

    Kind regards

    Nicos

  • I do not seem imputted sound keys on my 'effects', can anyone tell my why? or how to add

    I do not seem imputted sound keys on my 'effects', can anyone tell my why? or how to add

    Trapcode Soundkeys is a third-party plugin commercial. You need to buy it.

    Mylenium

  • How to add notes (stars) for comment in the layout of the Webapps list?

    How to add notes (stars) for comment in the layout of the Webapps list?

    Then... I've found a workaround. It's dirty and messy, and I don't know there's a better way, BUT using an Iframe in your list template that refers to your details page you CAN get the sides to work in list view.

    Here's what you do:

    1. place a comment form and the scoring module in your model detail page.

    2. place iframe in the list of your webapp template and point src = "detail_page_url".

    3. get this plugin to find the location of your scoring module in your details page: Page control - Chrome Web Store

    4. set the iframe scroll position so that when you view the list of your webapps it automatically queued upward at the position of the note on your details page module. Style the iframe using the attributes listed here: Scroll the IFRAME in a preset Position content

    So essentially of workaround reflects everything that happens in your detail page. Do not know if I explained that very well so if you need a clarification let me know.

  • How to add the chapter name and page not for reference

    Hello

    How to add the chapter name and page not for reference in indesign CS6.

    Thank you

    Please try variable notion of text

Maybe you are looking for