Need to concat multiple elements into a single element

Hello, here's my challenge:

Query:

(SELECT XMLROOT

XMLELEMENT ("Inv",

XMLAGG)

XMLELEMENT ("Invline",

XMLELEMENT ('Category', i.category)

XMLELEMENT ("Amount", i.amount)

'')

)

), VERSION "1.0"(, OUI AUTONOME).» EXTRACT ("/ *")

DE)

SELECT 1 AS corresponding inv_no, 'Work' AS category, 5 RISE FROM DUAL

UNION ALL

SELECT 1, 'their pocket', 10 OF the DOUBLE

UNION ALL

SELECT 1, 'Journey', 20 OF the DOUBLE

UNION ALL

1. SELECT 'Journey', DOUBLE 2.5) i;

Returns:

<? XML version = "1.0" standalone = "yes"? >

< Inv >

< Invline >

Labor < category > < / category >

< amount > 5 < / amount >

< / Invline >

< Invline >

< category > refundable < / category >

< amount > 10 < / amount >

< / Invline >

< Invline >

Trip to < category > < / category >

< quantity > 20 < / amount >

< / Invline >

< Invline >

Trip to < category > < / category >

< amount > 2.5 < / amount >

< / Invline >

< / Inv >

Mandatory:

<? XML version = "1.0" standalone = "yes"? >

< Inv >

< inv_no corresponding > 1

Labor < details > 5

Pocket 10

Travel 22.5

< / details >

< / corresponding inv_no >

< / Inv >

So I would support combining the details in a field for transmission to the Mexican tax authorities (their calls spec for all the lines of the invoice be concated together).

Note that there are two travel details that need to be summarized thus.

I wish I can not change the query if possible, just using the XML features.

Thank you!

And your version of db?

11.2 and beyond, you can use the aggregate LISTAGG function to concatenate the data type character in the whole of lines:

SELECT XMLElement ("Inv"

XMLAgg)

XMLElement "(corresponding inv_no

v.inv_no

XMLElement ("details"

listagg(v.category ||) ' ' || TO_CHAR (v.amount), 10

the Group (order by v.category)

)

)

)

)

DE)

SELECT t.inv_no

t.category

sum (t.amount) as the amount

DE)

SELECT 1 AS corresponding inv_no, 'Work' AS category, 5 RISE FROM DUAL UNION ALL

SELECT 1, 'pocket', 10 OF DOUBLE UNION ALL

SELECT 1, 'Journey', 20 DOUBLE UNION ALL

SELECT 1, 'Journey', DOUBLE 2.5

) t

T.inv_no GROUP, t.category

) v

GROUP BY v.inv_no;

Tags: Oracle Development

Similar Questions

  • Merge multiple images into a single file

    Hi all

    I am writing because I need to merge multiple images into a single file and do not know how.

    I need to create a large table with several aerial photographs, so I didn't need to create a panorama, but I would like to use an automatic procedure to merge the images because they are many.

    Can you help me??

    I tried photomerge but it creates more levels without ordering the photos...

    If all the files are the same size, there is a script "File Stitcher" @ http://www.ps-bridge-scripts.talktalk.net/

  • Can I put multiple PDFs into a single pdf file?

    Original title:

    PDF to PDF

    Can I put multiple PDFs into a single pdf file?

    I have a lot of files that consists of 1 page. Is it possible so that I can put them together and print them out?

    Otherewise I have to press the button print 60 times.

    You will need a software to do this. If you haven't already, Google for «combining PDF» There are also sites that allow you to do this online.

  • How can I scan multiple pages into a single file using the PIXMA MG2100 printer?

    Does anyone know how to scan multiple pages into a single file, jpeg, pdf, or word?

    Thanks for any help

    Sandy

    So that the community can help you better, we need to know exactly what operating system is running on your computer.  This and all other details you want to give only will help the community better understand your question! Thank you and have a great day!

  • How to scan multiple pages into a single document using the CanoScan LiDE 200?

    How to scan multiple pages into a single document using the CanoScan LiDE 200?

    I can't find a way to get them to analyze all the time, or a way to put together them later.

    Hi dagda24,

    You can scan multiple pages into a single document with the scan PDF option.  Use the following steps to do:

    1. open MP Navigator.

    2. click on a Clcik.

    3. click Save to PC.

    4. change the Type of PDF file to PDF (multiple pages).

    5 other changes, as needed, and then click Scan.

  • PSC 1210 Mac OS 10.6 scan multiple pages into a single pdf. and ink levels

    Now that I upgraded my Mac OS to Snow Leopard (10.6.8), I need to scan on my HP all-in-one psc 1210 is preview Scan & Fax system preferences. Once I scan a page and this page opens, I AM able to scan additional pages, but each is a separate document. The pilot only system available at HP is printed only and don't include a utility to check ink levels. Can someone help me with these two questions? (1) how do I scan multiple pages into a single pdf file. doc with my configuration, and (2) how to check the ink levels

    Even if it looks like Mac OS 10.6.8 I will not be able to scan multiple pages in a pdf, I thought I would send you a screenshot of the options available.

    Thanks for the help. I'll have to consider what software will no more work time if I upgraded to OS 7 and weighs against not being able to scan multiple pages in a pdf file.

    Christopher

  • combine multiple files into a single

    Hi all

    Request:

    1. the need to combine several files into a single

    2. the user already created destination doc

    3 folder contains about 30 files (all files having 1 page only)

    4. the need for a

    Script:

    1. to receive the forum script (combine multiple documents)

    2. using the forum script, the output comes wrongly (comes side by side)

    Fault output using the script below:

    Screen Shot 2015-05-31 at 8.05.38 PM.png

    Power required:

    Screen Shot 2015-05-31 at 8.08.48 PM.png

    Slightly modified:

    #target indesign
    // set the destination document as the active document.
    var destination_doc = app.activeDocument;
    destination_doc.documentPreferences.allowPageShuffle = true;  
    destination_doc.spreads[-1].allowPageShuffle = true;  
    
    // select the source folder
    var sourceFolder = Folder.selectDialog("Select a folder with source InDesign files.");
    var fileList = sourceFolder.getFiles();
    fileList.sort();
    
    for ( var i = 0; i < fileList.length; i++ ) {
        var source_file = fileList[i];
        
        if ( source_file instanceof File && source_file.name.match(/\.indd$/i)) {
            app.open(source_file);
            var source_doc = app.open(source_file);  
            var sourcePages = app.activeDocument.pages.item(0);
            sourcePages.duplicate(LocationOptions.AFTER, source_doc.pages.item(0));
            sourcePages.move(LocationOptions.AFTER, destination_doc.pages.item(-1));
            app.activeDocument.close(SaveOptions.NO);
        }
    }
    

    Thanks in advance

    Siraj

    Hello

    You should duplicate/move a spread instead of a page.

    Try simply change around L18 - 20 as below.

            var source_doc = app.open(source_file);
            var sourceSpreads = app.activeDocument.spreads.item(0);
            sourceSpreads.duplicate(LocationOptions.AFTER, source_doc.spreads.item(0));
            sourceSpreads.move(LocationOptions.AFTER, destination_doc.spreads.item(-1));
            app.activeDocument.close(SaveOptions.NO);
    

    Thank you

  • Manually to scan multiple Pages into a single PDF file.

    Gentlemen:

    My gear - 4620 HP all-in-One.

    Problem:

    I prefer to scan multiple pages into a single PDF file and save them on the hard drive manually.

    The ADF is twisting the pages that are saved in the PDF file.

    Please notify.  An upgrade of the software will be available for manual use set up of the

    pages on the glass?

    No other problems with the HP 4620.  I use Windows 7, 64 bit.

    Just reply to your convenience.

    PDF4ME

    PDF4ME,

    Watch it again once and document Scanning how-to - for Windows 7, I don't see that Preview Scan must be turned on to scan several pages.

    You can check again to see if you can get this works by following the instructions in the document.

    HP Officejet 4620 e-all-in-one printer support - scanning - Windows 7

    Click on the thumbs-up Bravo !

    It's a nice way of saying 'Thank you' for help.

    While I strive to reflect best practices of HP, I do not work for HP.

  • HP5610xi: Using a HP 5610xi, how can I scan multiple pages into a single file?

    Using a HP 5610xi, how can I scan multiple pages into a single file?

    Hello

    Thank you for using the HP Forums.

    Can try this software:

    HP extended Scan

    FTP://FTP.HP.com/pub/scanners/HPScanExt/HPScanExt.msi

    Once it has downloaded and installed, go to start > all programs > HP > HP Scan extended > Run "HP Scan extended.

    This relevant resource will show you how to scan multiple pages into a single file:

    HP Officejet Pro 6960 series: scan a document of 6 pages 2 sides using the ADF

    Let us know if it works!

  • How do I? Scan multiple pages into a single document

    How to scan multiple pages into a single document?

    If you let us know the scanner you are using as well as the name of the software, it would be easy to suggest the measures.

    See the following links for the procedure:

    http://support.HP.com/us-en/document/c01282192

    http://support.HP.com/us-en/document/nps05123

    http://support.HP.com/us-en/document/bps03330

  • 5514 photosmart e-all-in-one: scan multiple pages into a single PDF document?

    How can I scan multiple pages into a single multi-page PDF file?
    I saw posted similar questions, but I have not found all the right answers. The Council alone that I saw was to scan each page in a separate PDF document, then merge them into a single PDF using third party software.
    Of course, I don't want to do.
    I can't believe that there's really no way to do it using the existing HP printing/scanning utilities provided with the hardware.
    My printer/scanner is the "HP Photosmart 5514 e-All-in-One Printer - B111h", and I am running Vista (64 bit) on a HP Pavilion laptop.

    Hello

    The HP scanning software (start > programs > HP > Photosmart HP 5510 series > HP Scan) select PDF and make sure that the resolution is 300 dpi or less.

    Make sure the option Show Scan preview is checked, and click Scan.

    Once the first page of scanning is finished, place the next page on the window and click on the button "+" under the scan preview...

    Once you are done click Save.

    Shlomi

  • HP Officejet Pro X476dw (nextworked-Windows 7 Pro) how to scan multiple pages into a single file?

    Does anyone know how to scan multiple pages into a single jpegfile?

    When you scan a document of several pages in a file on a network each page gets its own jpeg image scanend file.

    HP standalone scanner allow generally allows you to add the multuple scans in a jpeg file.

    Any help much appreciated!

    Thank you

    Joihn

    Hello

    Well, I don't know how you can read many jpeg files into a SINGLE file. Put scanned images in a folder is a logical way to keep them in one place. From my understanding single jpeg image may be a ONE page document, but many jpeg images cannot be concatinated to be a multiple page document. We can use images, software publishing to put them in a single document, but still only one page (each image is smaller). Using pdf output, you can concatenate/merge a lot of images in a sinlge multi-page file.

    Kind regards.

  • How to scan multiple documents into a single pdf file of ADF on my MX922?

    How to scan multiple documents into a single pdf file of ADF on my MX922?


  • HP Envy printer 4501: HP Envy 4501 scan multiple pages into a single document

    My HP Envy 4501 printer won't let me not scan multiple pages into a single pdf document.

    I already made sure the box 'Create a separate file for each scanned page' is unchecked under the section of the file in the advanced settings .

    After I scan the first page, I do not get a screen with a + (plus sign) which is supposed to allow you to scan additional pages in the same document.

    Is it possible that I can get a fix/update my HP Envy 4501 printer software which would show the screen with the + (plus sign) which allows to scan additional pages in the same document after the first page that you scanned?

    At this point, if I don't get this problem fixed soon, I'm about to return my HP Envy 4501 printer to the store I bought so I can get my money back and buy a printer from one of the competitors of HP before my store warranty runs out.

    I am very displeased with the printing software HP, support services and web presence that does not work half the time.

    Thank you

    Mark

    Hello

    Lower the resolution of scan equal or lower to 300 DPI, scanning multiple pages is supported only on lower resolutions.

    Any higher resolution will not add additional pages.

    Shlomi

  • Over my OFFICE JET PRO 8600, how to scan multiple pages into a single document?

    How to scan multiple pages into a single document?

    Thank you

    Hi REDFIERO,

    I can help you scan multiple pages to a file.

    If you use a Mac, you can perform your analysis with HP Scan and when you save the file, choose PDF. Under the PDF Format you chose you will see the option to save all pages in a single file.

    If you are using a Windows operating system, follow the instructions in the following document, Scanning of multiple in a single PDF Pages.

    I hope this helps.

Maybe you are looking for