Xml output of a query

Hi,
I want to generate xml output of a query.
( suppose if i write select * from tab1 ; then i want all the rows from the table tab1 in xml form )
how to do it.. ?
plz guide.

I guess what you are loooking for is this
select xmltype(cursor(select * from dept)).getclobval() from dual;
this will give you the outout in a txt viewable format.
Rushi

Similar Messages

  • Extract XML output to a file from a Query

    Hi Gurus,
    I want to know how can I achieve this. Please post some sample code.
    i want to extract output of following query into xml
    select customer_name,address,phone,email
    from tn_customers
    where rownum <1001
    here i wil get 1000 records.
    Is there any way to generate mxl into a file from the above query?
    Please help

    First you must have defined a output directory:
    create directory OUTPUT_DIRECTORY as 'c:\work'
    Then you need a function which creates the xml for you, for example:
    function create_xmltype
    return xmltype
    is
    queryctx dbms_xmlquery.ctxtype;
    result clob;
    begin
    -- set up the query context...!
    queryctx := dbms_xmlquery.newcontext ('select customer_name,address,phone,email from tn_customers where rownum <1001');
    -- get the result..!
    result := dbms_xmlquery.getxml (queryctx);
    -- Now you can use the result to put it in tables/send as messages..
    dbms_xmlquery.closecontext (queryctx); -- you must close the query handle..
    return xmltype(result);
    end;
    And last but not least you must create the file. This is shown in next code:
    procedure write_file
    is
    cursor c_cur
    is
    select primary_id, clob_stuff
    from table;
    l_output_directory varchar2 (200) := 'OUTPUT_DIRECTORY';
    output_file utl_file.file_type;
    l_xml xmltype;
    l_blob blob;
    l_data_length number;
    l_offset number default 1;
    l_chunk constant number default 4000;
    l_csid number;
    l_csid_value varchar2 (100);
    begin
    -- make sure we are using correct character set id
    select value
    into l_csid_value
    from nls_database_parameters
    where parameter = 'NLS_CHARACTERSET';
    select nls_charset_id (l_csid_value)
    into l_csid
    from dual;
    for r_cur in c_cur
    loop
    l_xml := xmltype (r_cur.clob_stuff);
    l_blob := l_xml.getblobval (l_csid);
    l_data_length := dbms_lob.getlength (l_blob);
    -- Open the file
    output_file := utl_file.fopen (l_output_directory, r_cur.primary_id || '.xml', 'wb', l_chunk);
    loop
    -- Exit when our file offset is bigger than our file
    exit when l_offset > l_data_length;
    -- Write the output chunk by chunk
    utl_file.put_raw (output_file, dbms_lob.substr (l_blob, l_chunk, l_offset), true);
    -- Increment the offset by the amount written
    l_offset := l_offset + l_chunk;
    end loop;
    -- Close the file and reset offset
    utl_file.fclose (output_file);
    l_offset := 1;
    end loop;
    end write_file;

  • Want to create XML tag from the query

    Here i want to create a xml output from the below code for the given P_repair_number can anyone help me for the code i have written
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    facing the above error when run from concurrent program
    Procedure dfdfdf(p_repair_number number,
                              errbuf        OUT VARCHAR2,
                              retcode       OUT NUMBER) as
    v_error_code NUMBER; -- error code
      v_error_message VARCHAR2(255); -- error message
      v_text_msg VARCHAR2(100);
    cursor Rodetails(p_repair_number IN NUMBER) is
    SELECT
      dra.repair_number,
      dra.repair_line_id,
      items.concatenated_segments item_name,
      items.description item_desc,
      dra.inventory_item_id,
      sr.incident_number sr_incident_number,
      decode(dra.customer_product_id, '',dra.serial_number,cp.serial_number) serial_number,
      ltrim(oeh.order_number) rma_number,
      rstl.resource_name ro_owner_name,
      fndl.meaning flow_status_name,
      dra.status ro_status_code,
      drtt.name repair_type_name,
      dra.problem_description,
      dra.promise_date,
      rgtl.group_name repair_org_name,
      decode(dra.customer_product_id, '',dra.item_revision,cp.inventory_revision) revision,
      cp.lot_number,
      dra.unit_of_measure uom_code,
      uom.unit_of_measure_tl uom_name,
      dra.quantity,
      cp.instance_number ib_instance_number,
      plkup.meaning ro_priority_meaning
    FROM
      csd_repairs dra,
      csd_repair_types_tl drtt,  
      cs_incidents_all_b sr,
      csi_item_instances cp,
      fnd_lookups fndl, 
      csd_flow_statuses_b fsb,
      mtl_system_items_kfv items,
      mtl_units_of_measure_tl uom,
      jtf_rs_resource_extns_tl rstl,
      jtf_rs_groups_tl rgtl,
      oe_order_headers_all oeh,
      cs_estimate_details edt,
      csd_product_transactions txns,
      fnd_lookups plkup 
    WHERE dra.repair_type_id =  drtt.repair_type_id
      AND drtt.language = userenv('LANG')
      AND dra.repair_mode = 'WIP'
      AND dra.incident_id = sr.incident_id
      AND dra.CUSTOMER_PRODUCT_ID = cp.INSTANCE_ID(+)
      AND dra.flow_status_id = fsb.flow_status_id
      AND fsb.flow_status_code = fndl.lookup_code
      AND fndl.lookup_type = 'CSD_REPAIR_FLOW_STATUS'
      AND dra.inventory_item_id = items.inventory_item_id
      AND dra.unit_of_measure = uom.uom_code
      AND uom.language = userenv('LANG')
      AND dra.resource_id = rstl.resource_id (+)
      AND rstl.category (+) = 'EMPLOYEE'
      AND rstl.language (+) = userenv('LANG')
      AND dra.owning_organization_id = rgtl.group_id (+)
      AND rgtl.language (+) = userenv('LANG')
      AND dra.repair_line_id = txns.repair_line_id
      AND txns.estimate_detail_id = edt.estimate_detail_id
      AND edt.order_header_id = oeh.header_id
      AND edt.line_category_code = 'RETURN'
      AND dra.currency_code = oeh.transactional_curr_code
      AND dra.ro_priority_code = plkup.lookup_code(+)
      AND plkup.lookup_type(+) = 'CSD_RO_PRIORITY' 
      AND items.organization_id = cs_std.get_item_valdn_orgzn_id
      AND dra.repair_number=p_repair_number
      AND rownum <50;
    begin
    errbuf := NULL;
    retcode := 0;
      SAVEPOINT Create_external_orders;
      --retcode             := FND_API.G_RET_STS_SUCCESS;
      IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
        fnd_log.STRING (fnd_log.level_procedure, 'CSD.PLSQL.XXTNT_CSD_CREATEORDER.SUBMIT_CREATE_ORDER.BEGIN', 'Enter - PrintTraveller');
      END IF;
    --FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<?xml version="1.0"?>');
    --FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<REPAIR_ORDER>');
    FOR v_rodetails IN Rodetails(p_repair_number)
    LOOP
    /*For each record create a group tag <G_RODETAILS> at the start*/
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<?xml version="1.0"?>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<REPAIR_ORDER>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<G_RODETAILS>');
      FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<REPAIR_NUMBER>' || v_rodetails.repair_number ||
                                       '</REPAIR_NUMBER>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<REPAIR_LINE_ID>' || v_rodetails.repair_line_id
                                    || '</REPAIR_LINE_ID>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<ITEM_NAME>' || v_rodetails.ITEM_NAME
                                     ||'</ITEM_NAME>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<ITEM_DESC>' || v_rodetails.ITEM_DESC
                                    || '</ITEM_DESC>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<SR_INCIDENT_NUMBER>' || v_rodetails.SR_INCIDENT_NUMBER ||
                                       '</SR_INCIDENT_NUMBER>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<SERIAL_NUMBER>' ||v_rodetails.SERIAL_NUMBER
                                     ||'</SERIAL_NUMBER>');                               
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<RMA_NUMBER>' || v_rodetails.RMA_NUMBER
                                    || '</RMA_NUMBER>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<RO_OWNER_NAME>' ||v_rodetails.RO_OWNER_NAME ||
                                       '</RO_OWNER_NAME>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<FLOW_STATUS_NAME>' || v_rodetails.FLOW_STATUS_NAME
                                     ||'</FLOW_STATUS_NAME>');                                
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<RO_STATUS_CODE>' || v_rodetails.RO_STATUS_CODE
                                    || '</RO_STATUS_CODE>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<REPAIR_TYPE_NAME>' || v_rodetails.REPAIR_TYPE_NAME ||
                                       '</REPAIR_TYPE_NAME>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<PROBLEM_DESCRIPTION>' || v_rodetails.PROBLEM_DESCRIPTION
                                     ||'</PROBLEM_DESCRIPTION>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<PROMISE_DATE>' || v_rodetails.PROMISE_DATE
                                    || '</PROMISE_DATE>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<RO_OWNER_NAME>' || v_rodetails.RO_OWNER_NAME ||
                                       '</RO_OWNER_NAME>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<REPAIR_ORG_NAME>' || v_rodetails.REPAIR_ORG_NAME
                                     ||'</REPAIR_ORG_NAME>');                                
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<RO_STATUS_CODE>' || v_rodetails.RO_STATUS_CODE
                                    || '</RO_STATUS_CODE>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<REVISION>' || v_rodetails.REVISION ||
                                       '</REVISION>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<LOT_NUMBER>' || v_rodetails.LOT_NUMBER
                                     ||'</LOT_NUMBER>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<UOM_CODE>' || v_rodetails.UOM_CODE
                                    || '</UOM_CODE>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<UOM_NAME>' ||v_rodetails.UOM_NAME ||
                                       '</UOM_NAME>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<QUANTITY>' || v_rodetails.QUANTITY
                                     ||'</QUANTITY>');                                
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<IB_INSTANCE_NUMBER>' || v_rodetails.IB_INSTANCE_NUMBER
                                    || '</IB_INSTANCE_NUMBER>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<RO_PRIORITY_MEANING>' || v_rodetails.RO_PRIORITY_MEANING ||
                                       '</RO_PRIORITY_MEANING>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'</G_RODETAILS>');                             
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'</REPAIR_ORDER>');                                
    END LOOP;
    IF(retcode != FND_API.G_RET_STS_SUCCESS) THEN
                    RAISE FND_API.G_EXC_ERROR;
                  END IF;
                  IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
                    fnd_log.STRING (fnd_log.level_statement, 'CSD.PLSQL.XXTNT_CSD_CREATEORDER.SUBMIT_CREATE_ORDER', ' In PrintTraveller');
                  END IF;
    fnd_file.put_line(fnd_file.log, 'Successfully completed PrintTraveller');
    EXCEPTION
    || Catch all error.
    WHEN OTHERS THEN
    ROLLBACK;
    v_error_code := SQLCODE;
    v_text_msg := 'Fatal Error, Oracle Error is: '
    || TO_CHAR (v_error_code, '99999');
    fnd_file.put_line (fnd_file.log, v_text_msg);
    v_error_message := SQLERRM;
    fnd_file.put_line (fnd_file.log, v_error_message);   
    end dfdfdf;Edited by: user12053530 on Apr 19, 2010 5:54 AM

    However using SYS.ODCIVARCHAR2LIST makes sense if your query is a part of bigger processing (PL/SQL procedure or function) and you will do some processing depending on File_Type, like in this example (not compiled, could contain syntax errors):
    DECLARE
      l_stid           VARCHAR2(10);
      l_address        VARCHAR2(30);
      l_File_Type_tab  SYS.ODCIVARCHAR2LIST;
      cur_cursor IS SELECT STID,
                    ADDRESS,
                    CAST(COLLECT(DISTINCT File_Type) AS SYS.ODCIVARCHAR2LIST) AS File_Type
                    FROM (
                          SELECT STID,
                                 ADDRESS,
                                 File_Type
                            FROM DUMMY
                    GROUP BY STID, ADDRESS;
    BEGIN
      OPEN cur_cursor;
      <<main_loop>>
      WHILE (1=1) LOOP
         FETCH cur_cursor INTO l_stid, l_address, l_File_Type_tab;
         EXIT WHEN cur_cursor%NOTFOUND;
         -- Now do processing for each File_Type in l_File_Type_tab;
         <<each_file_type>>
         FOR i IN l_File_Type_tab.FIRST .. l_File_Type_tab.LAST LOOP
           -- for example:
           -- IF l_File_Type_tab(i) = 'SALES'
           -- THEN
           --   do_something(l_stid, l_address);
           -- ELSIF l_File_Type_tab(i) = 'TRANSFER'
           -- THEN
           --   do_something_else(l_stid, l_address);
           -- ELSE
           --   do_something_default(l_stid, l_address);
           -- END IF;
         END LOOP each_file_type;
      END LOOP main_loop;
      CLOSE cur_cursor;
    END;

  • How to generate PDF from XML output without XML publisher

    Hi,
    I am facing a problem while splitting the rdf generated XML output.
    Problem Description:
    I have a oracle invoice report which runs once every day (scheduled program). This report fetches me the invoices generated on that day and needs to be Mailed / Faxed to the customers.
    So i developed the report in such a way that it generates the output order by customers...since the output generated will be as one .out file in APPLCSF/out directory...the .out file needs to be splitted by customers, for which i have written a cursor which takes the data of the main query and submits that many requests as many as customers are there.....There is a possibility of having 1000 customers per day also. If that is the case then my main program will fire that many requests.
    Is there a different approach......any inputs are highly appreciated.
    Also, i am generating the output in XML format. Is there a way from which i can directly generate a PDF from that XML output rather using any other tool.
    Thanks & Regards,
    Lakshmi Kalyan Vara Prasad.

    Hi,
    with Reports Bursting and the defined "distributions" it's possible to have one report splittet to several parts with different receipients. Have a look at http://download-uk.oracle.com/docs/cd/B14504_01/dl/bi/B13673_01/pbr_dist.htm.
    With xsl-fo it's possible to create pdf out of xml ... that's what xml publisher is doing.
    Regards
    Rainer

  • Generating and Viewing XML Output without rdf

    Howdy,
    I have been dev Oracle Forms/Reports for over 10 years. We are now migrating all of our reports to BIP.
    To date when I have been developing these reports I have been using the old rdf files to "generate to a file" and thus get a nice, quick and dirty XML output file (what I am calling a “datafile”). Using this makes it substantially easier to then dev the format template. However going forward I/we would like to completely remove the Designer 2000 tool entirely when it comes to report development.
    How can we as developers can get our hands on the XML "datafiles" that are generated by the data templates in BIP? Are these stored anywhere on the server for the viewing? Is there another tool I can pop my Data template and SQL into and generate XML ‘with’ the correct groupings, ect.?
    Thanks in advance for any assistance/guidance you can provide.
    ScottC

    Or, from the browser see Note:394631.1
    1.Using System Administrator responsibility
    Nav:Profile->System
    query Viewer: Text, set this to Browser and save
    2. Using your Receivables responsibility
    Run the the XML report that is failing, note the request_id
    when it finishes, even with errors do this,
    View->Requests
    query this request_id
    click on Diagnostic button->View XML
    save the file to your PC by doing File->Save As
    3. Upload this XML data file.

  • In XML Output the values of Number column tags are not displayed properly

    Hi,
    Our Client have been using AR Invoice Print Program for a long time and it is heavily customized. Also they are using an old version of the RDF. So we have taken the latest version of the RDF (RAXINV.rdf) for Oracle Apps 11.5.10.2 by raising a SR and implement Client's old RAXINV.rdf into it.
    All was ok, but when we are running the program, the XML Output did not generate properly. For the Q_INVOICE query (G_ORDER_BY, G_INVOICE and G_INV_TERM group), the value of some of the scaler number columns are not appeared properly. The tags are coming correctly, but the value is appearing as '*', instead of the correct value. We have checked in the RDF Level (By putting srw.message and check in the log file) that those columns are having proper value. So there is no issue with the RDF.
    But because of the above mentioned problem, the some of the PDF output field values also is not generated correctly.
    I think that because of the lexical parameters which was implementing the Q_INVOICE query (&COMMON_QUERY) this issue is coming. Because the issue is only in the Q_INVOICE query group (G_ORDER_BY, G_INVOICE and in G_INV_TERM group) not in any other query group.
    There is no problem with the scaler character columns. The issue is only with the number columns.
    Also we have checked that if we hardcode the value of the number columns in the above mentioned lexical parameter, this problem doesn't appear.
    If we put TO_CHAR function to those number columns in the lexical parameter (COMMON_QUERY), then this issue get solved. But we can't do it because of performance issue and also Client won't approve it.
    Please help.
    With Thanks and Regards

    I don't know how to read the code you pasted or I would have checked this myself.
    Do your fields in the internal table reference dictionary objects or elementary types? If not using dictionary types, the column names will be blank by default. If you can't change your fields to be dictionary types, you can try this to change the column names:
    I made a method inside my local class to add the names:
            call method set_colname
              EXPORTING iv_tab = alv_tab
                        iv_colid = 'xxxx'  "fieldname from the table
                        iv_stxt = text-t54
                        iv_mtxt = text-t55
                        iv_ltxt = text-t55.
    METHOD set_colname .
      data:
              alv_cols type REF TO cl_salv_columns_table,
              alv_col type REF TO cl_salv_column.
      TRY .
    *... Change fieldnames
            call METHOD iv_tab->get_columns RECEIVING value = alv_cols.
            call method alv_cols->get_column EXPORTING columnname = iv_colid RECEIVING value = alv_col.
            IF iv_stxt <> ''.
              CALL METHOD alv_col->set_short_text EXPORTING value = iv_stxt.
            ENDIF.
            IF iv_mtxt <> ''.
              CALL METHOD alv_col->set_medium_text EXPORTING value = iv_mtxt.
            ENDIF.
            IF iv_ltxt <> ''.
              CALL METHOD alv_col->set_long_text EXPORTING value = iv_ltxt.
            ENDIF.
       CATCH cx_salv_not_found.
      ENDTRY.
    ENDMETHOD. "set_colname

  • How to do UNION in an XML output

    How to do union in an XML output
    I have a requirement that I need to combine the results of 2 queries and get the final XML output. Typically this sound very easy and can b
    be done with a simple UNION operator. But my query is a hierarchical query with CURSOR at the column level
    For example
    SELECT
    EMPNOm
    CURSOR(
              SELECT
                        DEPTNO
                        FROM
                        DEPT
                        WHERE
                        EMPNO = :EMP_NO) AS DEPT
    FROM
    EMP
    In oracle 9i UNION is not allowed in nested queries. One workaround is to populate the data from query one in a temp table and then from query 2 finally fetch the data from this temp table.
    Can this requirement be fulfilled in any easirer way using SQLX or something else. Please suggest me .
    Thank You

    I'm afraid I have no idea what you are trying to achieve with Query you have posted. Can ypu provide some idea of what you would want the output of the query to look like given the data in the EMP and DEPT tables and a given value of EMPNP...

  • Regarding  the rowset and row tags in the XML output

    Hi,
    We generated an XML file using dataset of type SQL query.The output is including additional tags
    <ROWSET> and <ROW> tags.How to disable them from appearing in the XML output.

    Hi,
    Iam not using the Datamodel of data template type.If we use the data template we can disable the rowtags by setting the property mentioned by you.But we get the data template name and the query name included in the output.My requirement is to disable the extratags.
    Can u please provide inputs on how to disable the datatemplate name and the query name tags in the output when we use datatemplate.Thank you.

  • Emailing output of a query

    Hi All,
    please could you guide me on how can I get an email with output of a query?
    Ex : select * from abc
    the above query output, i'd like to get in a table form to my email. please help.
    Thanks in Advance
    Vinod Mallolu
    Cheers, Vinod Mallolu

    There's a good example of this on msdn in the
    sp_send_dbmail documentation
    DECLARE @tableHTML NVARCHAR(MAX) ;
    SET @tableHTML =
    N'<H1>Work Order Report</H1>' +
    N'<table border="1">' +
    N'<tr><th>Work Order ID</th><th>Product ID</th>' +
    N'<th>Name</th><th>Order Qty</th><th>Due Date</th>' +
    N'<th>Expected Revenue</th></tr>' +
    CAST ( ( SELECT td = wo.WorkOrderID, '',
    td = p.ProductID, '',
    td = p.Name, '',
    td = wo.OrderQty, '',
    td = wo.DueDate, '',
    td = (p.ListPrice - p.StandardCost) * wo.OrderQty
    FROM AdventureWorks.Production.WorkOrder as wo
    JOIN AdventureWorks.Production.Product AS p
    ON wo.ProductID = p.ProductID
    WHERE DueDate > '2004-04-30'
    AND DATEDIFF(dd, '2004-04-30', DueDate) < 2
    ORDER BY DueDate ASC,
    (p.ListPrice - p.StandardCost) * wo.OrderQty DESC
    FOR XML PATH('tr'), TYPE
    ) AS NVARCHAR(MAX) ) +
    N'</table>' ;
    EXEC msdb.dbo.sp_send_dbmail @recipients='[email protected]',
    @subject = 'Work Order List',
    @body = @tableHTML,
    @body_format = 'HTML' ;
    Hope that helps

  • XML Output doesn't work

    Hi everyone, im a newer in using BI Publisher, so when I create the Data Model then save and click Get XML Output, it's not work( just blank window is appear, what's wrong with it?

    are you sure that your query is correct ?
    or may be no data for query for some values of parameters ?

  • SQL * Plus to XML output

    Hi,
    I have a requirement for a report , report output should be in Excel.
    I created a sql query using user defined functions and inline query. I registered the query in concurrent program with XML output. When I run the request i'm getting the below error
    The XML page cannot be displayed
    Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
    Invalid at the top level of the document. Error processing resource 'http://opusapp1.co.pinellas.fl.us:8010/OA_CGI/FNDWRR.e...
    If the output is text then i got the output. I need the XML output, so that i can create XML template.
    Thanks for your help.

    Please post the details of the application release, database version and OS.
    Please see if (Report Output Error: The XML page cannot be displayed. Cannot view XML input using style sheet. [ID 753620.1]) helps.
    Also, see old threads for similar discussion about generating Excel output format -- http://forums.oracle.com/forums/search.jspa?threadID=&q=Excel+AND+XML+AND+Publisher&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

  • Created Excel Template XSL, but XML output always open IE (not Excel)

    Hello,
    We are using :
    -     XML Publisher : 10.1.3.4.1
    -     Oracle Appli : 11.5.10.2 ( DB : 10.2.0.4.0)
    - Oracle Reports Builder : 10.1.2.0.2
    We use Reports for building the query that is used with XML Publisher.
    We would like to use XML Publisher with an output Excel.
    After noticing a problem with display of numeric cells when using a RTF template ( decimal places, there's a lot of threads on this), we decided to follow an advice on xlspe.com, and we created a Excel template, that we saved as a XML Spreadsheet, and using the xlspe tools, we generated the XSL file.
    Then we defined everything in Oracle Applications EBS:
    - data definition
    - template ( XSL-XML as input, and XML as output. Note that XML is the only option)
    - executable ( execution method "Oracle Reports" )
    - program request : ( output format XML )
    This works fine when the use a RTF template with an output Excel. (except the issue on the decimal places). in the concurrrent requests form, the output button opens Excel correctly.
    When we go with a XSL template, with an output XML, the output generation works fine, but, in the concurrent requests form, the output button opens internet explorer IE instead of Excel (probably because it's a XML output file)
    I hope my explanation is clear.
    Did I make a mistake in the definition ?
    Is there anyone who has experienced and solved this issue ?
    Thanks a lot in advance,
    Olivier

    Hello,
    After many talks, I found out how to fix this issue.
    Basically, the issue is in Oracle Application where the MIME type is not defined for XML Excel type files.
    By default, XML is open with the browser.
    For solving the opening of XML Excel files with Excel (and not Internet Explorer IE), we had to add under the "System Admin > install > Viewer Options " a new entry for " XML - application/xnd.ms-excel - Microsoft Excel "
    And also, under the System profiles, for option "Viewer: Application for XML", set the value to Microsoft Excel, and, as well, for option "Viewer: Application : Text", set the value to Browser.
    This resolves the issue, and a XML Excel file generated by XML Publisher (from a XSL-XML template), is opened directly with Excel.
    Thanks for your contributrion,
    Olivier

  • XML output to a file

    Hi,
    I am using XSU to querry a table and generate XML output.
    When I execute a file (say for example test.sql), is there a way I can save this XML output to a file (say 'something.xml') ??
    Can any one help ?
    Thanks.
    vikram

    Hi,
    Thanks for your reply.
    But I am sorry I didn't get you. I can't use the second option because I am not using XSQL.
    Coming to the first option, I didn't understand where to type
    java OracleXML ... > SomeFile.xml
    Can you explain pls ?
    Once again this is what I have got....
    Say, I have a file test.sql which contains the following code
    select xmlgen.getXML('select * from scott.emp1',1) from dual;
    commit;
    set serveroutput on
    Now, when I execute the file in SQL prompt I get the following output.
    <ROWSET>
    <ROW num="1">
    <EMPNO>7369</EMPNO>
    <ENAME>SMITH</ENAME>
    <JOB>CLERK</JOB>
    <MGR>7902</MGR>
    <HIREDATE>1980-12-17 00:00:00.0</HIREDATE>
    <SAL>800</SAL>
    <DEPTNO>20</DEPTNO>
    </ROW>
    <ROW num="2">
    <EMPNO>7499</EMPNO>
    <ENAME>ALLEN</ENAME>
    <JOB>SALESMAN</JOB>
    <MGR>7698</MGR>
    <HIREDATE>1981-02-20 00:00:00.0</HIREDATE>
    <SAL>1600</SAL>
    <COMM>300</COMM>
    <DEPTNO>30</DEPTNO>
    </ROW>
    </ROWSET>
    I want this result to go to a file (.xml) instead of displaying the output in the SQL prompt.
    How do I do this ? Pls explain. Thanks.
    vikram
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Steven Muench ([email protected]):
    Two ways:
    (1) Just redirect the output to a file like:
    java OracleXML ... > SomeFile.xml
    (2) Use the XSQL Command Line utility
    and build an XSQL Page that describes
    the query you want to do. Then you can
    do:
    $ xsql yourfile.xsql SomeFile.xml<HR></BLOCKQUOTE>
    null

  • Help on XML output challenge needed

    Hello,
    I need some help on getting different data from different relational tables into one XML output.
    Fe: I have 3 different sql queries with no strait relation. Now I want this as a xml document. How can I create a generic method to convert this into xml?
    The situation is as follows:
    the 3 sql queries together produce the data for a report (Fe. header, body, footer).
    I want this transformation in a generic way, so that I do not have to do the xml transformation for each query hardcoded.
    Thanks,
    Edward

    Maybe something like this?:
    select xmlconcat(xml) from (
        select dbms_xmlgen('select * from query1') xml from dual
        union all
        select dbms_xmlgen('select * from query2') from dual
        union all
        select dbms_xmlgen('select * from query3') from dual)

  • Use of XML output

    Hello Everyone !
    I have just started working on MII and what I have studied yet is, in MII we are normally getting the value in XML format. So can anyone please explain how can we use this XML output in real scenario ?
    Regards,
    Vaibhav Singhania

    Hi Vaibhav,
    Whenever you will query a external tool for MII through from Query/Webservices/Action blocks you will get data back in XML format.
    You can manipulate using XML function action blocks or SAP MII XML Output action blocks.
    depending upon your requirement you can send the data to some other system or you can map data to ouput.
    and display in igrid/ichart through xacute query.
    Hope it helps!!
    Thanks
    Anshul

Maybe you are looking for