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...

Similar Messages

  • How can print blank rows for XML output report..

    Hi all,
    I am working in XML output PO fix format report and in that report there is 3 sections. (1) Header section(2)Line section (3) Footer section. My requirement is like this, header and footer section print in all pages and line section break for next page after printing fix 15 lines in a page. And if any page has less then 15 lines then it generate remaining blank row to maintain footer position.
    Please suggest me, how can i generate blank rows and break lines for page if there is more then 15 rows in Line section.
    Thanks in Advance!

    Hi,
    <?for-each:ROW?>
    <?end for-each?><xsl:variable name="cnt" select="count(//row|//ROW)" />
    <?for-each:xdoxslt:foreach_number($_XDOCTX,1,15-count(ROW),1)?> <?end if?>
    this will create 15 lines irrespective of you have that much rows of data in xml or not
    if you want more help , drop me mail @ [email protected]

  • How to remove default comment from XML output

    Hi,
    I have a requirement to generate the XML report with XML output(Not PDF). Everything is working fine except I am getting one comment line "<!--Generated by Oracle Reports version 6.0.8.28.0--> which is not required and I want to remove this line. This report will be run through Oracle Apps 11i.
    Thanks.

    Hi,
    There is option to change the "Prolog Value" but nothing is there to remove the comment.
    Thanks

  • Please help! XML output needed for OBIEE report.

    Hi,
    I need an xml output of the OBIEE report. I have tried extrating the xml result using GO url but the xml format is not satisfactory. The default output assigns C0,C1..column names to each column data while on the other hand I need the name of the column and not C0 or C1.
    Hence, can anyone please suggest as to how can I format the OBIEE xml output internally i.e. without doing it manually.
    Please let me know if more explanation is required.
    Thanks in advance!!

    Hi,
    Thanks for the response but unfortunately Bi Publisher is even not giving the required output.
    The output of Bi Publisher is like
    <_170627_>170627</_170627_>
    <_TRADES_._TRADE_ID_>2996</_TRADES_._TRADE_ID_>
    <_FALSE_>FALSE</_FALSE_>
    <_N_>N</_N_>
    <_170627_>170627</_170627_>
    <_R_>R</_R_>
    and the output of OBIEE is
    <C0>170627</C0>
    <C1>2996</C1>
    <C2>FALSE</C2>
    <C3>N</C3>
    <C4>170627</C4>
    <C5>R</C5>
    <C8>B</C8>
    In both the cases I get leading and trailing tags which are not required. Ideally according to the requirement C0 should have been Trade ID, C2 - Cancellation option and so on.
    The BI Publisher does give the output to some ectent but lans up capturing the table name also as u see it is Trades.Trades Id. I even reuire few extra tags which caary report information and this data is not being pulled from database.
    Hence please help!! I am really very much confused!!
    Thanks!!!

  • XML output with UTF8 Encoding scheme

    In external partner wants that we provide him an XML file with data, encoded in UTF8 format.
    Using the SQL/XML functions I can construct the XML with the structure (shcema) he asks for.
    But how can I guarantee that my XML-output is in UTF8, because our oracle database has been built in the default character set WE8ISO8859PI.
    I suppose it is not enough to add in front off my document: <?xml version="1.0" encoding="UTF8"?> ?

    Jan,
    You may want to check on metalink for WE8iso8859P1 to see if it is a subset of UTF8. There are some documents on metalink that discuss the UTF8 character set and ways to pull differenct character sets and conversion from the database depending on what is stored in the database, or changing the database character set to UTF8.
    Have you tried a test extract to see if the characters are correct?

  • How to get XML output from a stored procedure

    I have a very simple question:
    I would like to write a stored procedure (SP) that will return results in XML format (as a string). My tables in database are not of XML TYPE. But I need XML output.
    ie, SP will run like a typical SP but the only difference will be its output in XML.
    1) is it possible?
    2) if possible, how?
    Please, help
    Omer Koksal

    Thank you Peter, it was a great problem for me !
    Omer Koksal

  • How to create a xml output in report 2.5

    Hi
    Please Anyone using reports 2.5 and trying to
    implement XML outputsolutions ?? I have some
    oracle reports that need to produce XML output
    I know that 6i supports XML output. i dont know
    how to do in 2.5. If anyone has done anything similar
    to this, I'd be interested in hearing different solutions?
    Thanks,
    Parthi

    [ajayubbott],
    I am not sure if you should create another folder to house all your servlets when using Java Web Server 2.0.
    The servlet invoker of Java Web Server 2.0 looks at the <server_root directory>/servlets/ directory as the root servlet directory by default and any servlets that is housed under this directory is monitored by the custom class loader provided by Java Web Server 2.0.
    This custom class loader will automatically reload any serlvet class files that are modified i.e. a newer version of the servlet that is newly compiled e.g. change in functionality. What this means is that you don't have restart the web server to reload any new version of the existing servlets on the web server.
    HTH.
    Allen Lai
    Developer Technical Support
    SUN Microsystems
    http://www.sun.com/developers/support/

  • How to create a errortag in the XML-Output ?

    Hey
    who can help me creating a error-tag in my XML-output of a PL/SQL procedure ?
    Enviroment:
    Oracle DB is 8.1.7 with installed XDK-package (in a few
    weeks perhaps Oracle 9i). I've no problems to use the dbms_xmlquery-functions and -procedures.
    I've to develop a PL/SQL procedure which is called via JDBC from a JAVA program. The procedure execute a Select-Statement. The result is transformed in XML and stored in a CLOB, which is given back to the calling JAVA-program.
    There exist 2 possible result-situations.
    -1- one or more rows are found
    -2- no row is found
    Problem:
    For each of these situation the XML-Output should have a different structure and my main problem is to integrate the errortag !!!
    for -1-
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <data>
    <error err_code="NoError"/>
    <record num="1">
    </record>
    <record num="2">
    </record>
    </data>
    for -2-
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <data>
    <error err_code="NoDataFound"/>
    </data>
    Hope somebody can help me ???
    Andre

    Hey Rajat,
    thanks for your answer, but the errortag is needed by another department. They use it for their processing.
    Have you got any idea, how to integrate the errortag with the functions or procedures of the dbms_xmlquery package ??? I've got only a few days experience with the dbms_xmlquery-package, so some code examples or advices would be great !!!
    I've tried the following coding:
    out_xmlresult OUT CLOB; -- OUT Parameter of the PLSQL-Proc
    c1 CLOB;
    queryctx dbms_xmlquery.ctxtype;
    -- create XML-context
    queryctx:=dbms_xmlquery.newcontext(<selectstatement>);
    -- delete the rowsettag (use 'data' later on)
    dbms_xmlquery.setrowsettag(queryctx,'');
    -- create new tag 'data' which enclose an empty header
    -- and the data section
    dbms_lob.createTemporary(c1, TRUE );
    c1:=EMPTY_CLOB();
    dbms_xmlquery.setDataHeader(queryctx,c1,'data');
    -- rename rowtag
    dbms_xmlquery.setrowtag(queryctx,'record');
    -- set encoding tag
    dbms_xmlquery.setEncodingTag(queryctx,'ISO-8859-1);
    -- create XML-Output
    out_xmlresult := dbms_xmlquery.getxml(queryctx);
    ...but I haven't got any success !!!
    Andre

  • How to send job postings to multiple third party sites using the XML output

    Dear Friends,
    We are Implementing Irecruitment for our client, Client requirement is how can we send job postings to multiple third party sites using the XML output from i-Recruitment
    With regards
    Surya
    .

    Can you be more specific about your Requirement. In General, Please navigate to iRecruitment Recruiter Responisbility.
    Then Select, Setup > Recruiting Sites. Here, you can configure your Third Party Websites information and attach stylesheets. The default mode oracle sends the vacancy information is HR-XML Format.
    If you would like to select more sites information select "Add Another Row".
    Then, you can see this information while "New Vacancy Creation Process".
    iRecruiter.
    Edited by: iRecruiter on Oct 18, 2009 7:43 AM

  • How to Generate XML Output file

    Hi,
    I want to print sample output XML file.
    I got this link 362496.1
    An output file can be generated via the Preview functionality available under the XML Publisher Administrator responsibility. Navigation path :
    1. Login to the application as SYSADMIN
    2. Responsibility: XML Publisher Administrator
    3. Function: Templates
    4. Select a Template for which a Preview Data file has been uploaded in the past.
    5. Click on the Preview icon
    6. Save the PDF to the client PC
    7. Determine the version either by the above instructions OR by provide the PDF file to Global Customer Support.But in #4 I can not populate any values to search, even if I put all %.
    How can I get a valid search?
    Thanks a lot,
    Ms K

    Hi;
    AFAIK if you prepare template in XML publisher than you can take output as pdf, by the way you can take xml output too
    Please check user guide:
    http://www.oracle.com/technology/products/xml-publisher/docs/XMLP5.6.1UserGuide.pdf
    Oracle XML Publisher and Oracle Reports
    Oracle XML Publisher and Oracle Reports
    Also Please check below thread:
    XML output for pdf concurrent program
    http://www.quovera.com/whitepapers/downloads/xml_oracle.pdf
    Generate XML output using DBMS_XMLGEN.getxmltype and not from rdf
    http://www.orafaq.com/forum/t/35204/2/
    Hope it helps
    Regard
    Helios

  • How to produce an XML output

    Hi,
    can someone tell me if and how it's possible to get an output of a select in XML format in Oracle? Is there some PDF explaining how to do it?
    I work on Oracle version 8i
    Thanks!

    i dont no in version 8i
    but i working on oracle 9i & 10g with xml..
    sample...
    xml-select statement..
    SELECT XMLAGG(XMLELEMENT("UsageRecord",
    XMLFOREST(DU.METER,
    TO_CHAR(DU.DAILYTIMESTAMP, g_timeStampFormat) DAILYTIMESTAMP,
    DU.TOTALENERGY,
    DU.STATUSID,
    DU.AVERAGEUSAGEDAYS,
    DU.SPIKEPERCENT,
    DECODE(DU.STATUSID, 3, 'Estimated', 5, 'Averaged', 2, 'Error', 'Calculated') "USAGETYPE",
    (SELECT ( XMLAGG(XMLELEMENT("Validation",XMLFOREST(ED.ERRORID, DECODE(ED.ERRORID, 10, 'Illegal Usage', 11, 'Usage Spike') "ERRORDESC")))) xe FROM ERROR_DETAIL ED WHERE ED.ERRORKEY = DU.USAGEID) "Validations"
    ).GETCLOBVAL()
    FROM DAILY_USAGE DU LEFT OUTER JOIN ERROR_DETAIL ED ON DU.USAGEID = ED.ERRORKEY
    WHERE DU.METER = cp_meter AND DU.DAILYTIMESTAMP >= cp_usageFrom AND DU.DAILYTIMESTAMP <= cp_usageTo;
    output is:
    Input: '<InputParameters><ParamSet>
    <METER>17209346</METER>
    <READINGSSTARTTIME>31-MAR-10</READINGSSTARTTIME>
    <READINGSENDTIME>15-APR-10</READINGSENDTIME>
    </ParamSet></InputParameters>';
    Output:
    <Output><UsageRecords><UsageRecord><METER>17209346</METER><DAILYTIMESTAMP>06/15/2010 00:00:00.000000</DAILYTIMESTAMP><TOTALENERGY>29</TOTALENERGY><STATUSID>1</STATUSID><USAGETYPE>Calculated</USAGETYPE><PEAKKVAR>0</PEAKKVAR><ENDREADING>66882
    </ENDREADING><USAGEID>32151771</USAGEID><LATESTREADINGID>29049733</LATESTREADINGID></UsageRecord><UsageRecord><METER>17209346</METER><DAILYTIMESTAMP>06/16/2010 00:00:00.000000</DAILYTIMESTAMP><TOTALENERGY>57</TOTALENERGY><STATUSID>1</STATUS
    ID><USAGETYPE>Calculated</USAGETYPE><PEAKKVAR>0</PEAKKVAR><ENDREADING>66939</ENDREADING><USAGEID>32217320</USAGEID><LATESTREADINGID>29049735</LATESTREADINGID></UsageRecord><UsageRecord><METER>17209346</METER><DAILYTIMESTAMP>06/17/2010 00:00
    :00.000000</DAILYTIMESTAMP><TOTALENERGY>58</TOTALENERGY><STATUSID>1</STATUSID><USAGETYPE>Calculated</USAGETYPE><PEAKKVAR>0</PEAKKVAR><ENDREADING>66997</ENDREADING><USAGEID>32282871</USAGEID><LATESTREADINGID>29049737</LATESTREADINGID></Usage
    Record><UsageRecord><METER>17209346</METER><DAILYTIMESTAMP>06/18/2010 00:00:00.000000</DAILYTIMESTAMP><TOTALENERGY>56</TOTALENERGY><STATUSID>1</STATUSID><USAGETYPE>Calculated</USAGETYPE><PEAKKVAR>0</PEAKKVAR><ENDREADING>67053</ENDREADING><U
    SAGEID>32348421</USAGEID><LATESTREADINGID>29049739</LATESTREADINGID></UsageRecord><UsageRecord><METER>17209346</METER><DAILYTIMESTAMP>06/19/2010 00:00:00.000000</DAILYTIMESTAMP><TOTALENERGY>35</TOTALENERGY><STATUSID>1</STATUSID><USAGETYPE>C
    alculated</USAGETYPE><PEAKKVAR>0</PEAKKVAR><ENDREADING>67088</ENDREADING><USAGEID>35780363</USAGEID><LATESTREADINGID>34626182</LATESTREADINGID></UsageRecord><UsageRecord><METER>17209346</METER><DAILYTIMESTAMP>06/20/2010 00:00:00.000000</DAI

  • How do I read a report's XML Output from a procedure?

    I am using E-Business suite 11.5.10.2 and XMLP 5.5. I have a report that will output XML. When this report is run, I can click the 'View Output' button and view the XML. This appears to be a temp file somewhere, because the temp id in the URL changes each time a new report is run. Here's my problem: After running this report, I want to execute a procedure that will loop through the XML output and transform it into HTML. I will then output this HTML to the screen. But I'm not sure how to pass this file as a parameter to my procedure.
    Is there anyway to allow a procedure to consume the XML output?
    The reason I'm trying to do this, is because we need to transform certain reports into Excel format. This is becoming a critical issue. After testing, I found that if I can extract data into an HTML table and display it on the screen, it dumps perfectly into Excel. I tested it using a cursor, but that won't work for production reports. There is a ton of logic built into these Oracle reports, so I need to go the XML route after running the report.
    Looking at previous posts, the current Excel output process seems to be a bit buggy. And, we can not upgrade to Excel 2003 at this time.
    Any ideas would be greatly appreciated!!!
    Thanks.
    Mark K

    Hello Klaus. I appreciate your response. While I'm no expert with XMLP, I have created about 8 production reports using XMLP. I am using XMLP 5.5, and not 5.6.1 I am using Excel 2002 and not Excel 2003. From other posts (shown below), it is my understanding that the Excel output may have bugs unless you're using XMLP 5.6.1 and Excel 2003.
    Please see the following posts for more information:
    Re: EXCEL output not displaying properly
    Excel output in 5.6 version
    Also, when I tried to output to Excel using my desktop version, I received an error message. But, when I switch to PDF format, it opens just fine.
    We are not prepared to upgrade Excel and/or install another patch for XMLP at this time. If I can do what I need to do programmatically, I will have much more leverage when it comes to troubleshooting. On the other hand, when I run into a bug with Oracle software, I usually have to wait for a patch.
    Thanks again.
    Mark K.

  • How to save xml output of fm into sap as xml

    how to save xml output of fm into sap as xml
    thank you,
    regards,
    Jagrut bharatkumar shukla

    Hi Jagrut
    The XML document can be stored in an ABAP variable rxml of the type STRING or XSTRING, or in an internal standard table sxml of the elementary line type C. Hence, I believe, your issue with the lenght can be resovled with this types.
    For rxml, you specify an interface reference variable of the type IF_IXML_OSTREAM that points to an IXML output stream.
    For rxml, you specify an interface reference variable of the type IF_IXML_DOCUMENT that points to an IXML document.
    With the stream factory you have several options. Before you call your CALL TRANSFORMATION, you setup your stream factory for these different options.
    1. You want to write the file to the application server file system. You want to create your OSTREAM as a binary string. In this example b_xml is an empty binary string. OSTEAM will be the reference variable of tyep IF_IXML_OSTREAM.
    ostream =
    streamfactory->create_ostream_xstring( b_xml ).
    You get the output lenght with the following:
    ressize = ostream->get_num_written_raw( ).
    You can then send the entire string to the file system with the following:
    transfer b_xml to filename1 length ressize.
    Also refer to this weblog:
    /people/tobias.trapp/blog/2005/05/04/xml-processing-in-abap-part-1
    Regards
    Ravish Garg
    <b>
    *Remember reward points is the best way to say thank you :)</b>

  • How to generate the following XML-Output?

    Hi all,
    I would like to generate the following XML-Output without defining any types or tables:
    <?xml version = '1.0'?>
    <DEPARTMENTS_EMPLOYEES>
    <DEPARTMENT NAME="ACCOUNTING">
    <DEPTNO>10</DEPTNO>
    <LOC>NEW YORK</LOC>
    <EMPLOYEES_OF_DEPARTMENT>
    <EMPNO>...</EMPNO>
    <ENAME>...</ENAME>
    </EMPLOYEES_OF_DEPARTMENT>
    </DEPARTMENT>
    <DEPARTMENT NAME="RESEARCH">
    <DEPTNO>20</DEPTNO>
    <LOC>DALLAS</LOC>
    <EMPLOYEES_OF_DEPARTMENT>
    </EMPLOYEES_OF_DEPARTMENT>
    </DEPARTMENT>
    </DEPARTMENTS_EMPLOYEES>
    Unfortunately the following SQL-Statement does not working:
    select xmlElement("DEPARTMENTS_EMPLOYEES",
    xmlAttributes(d.deptno as "DEPTNO"),
    xmlElement("DNAME", d.dname),
    xmlElement("LOC", d.loc),
    xmlElement("EMPLOYEES_OF_DEPARTMENT",
    (select xmlAgg(xmlElement("EMPLOYEE", xmlAttributes(e.empno as "EMPNO"), xmlForest(e.ename as "ENAME", e.job as "JOB", e.hiredate as "HIREDATE", e.sal as "SAL", e.comm as "COMM", m.empno as "MGRNO", m.ename as "MGRNAME" ) )
    from emp e, emp m
    where e.deptno = d.deptno
    and m.empno = e.mgr
    ) as XML
    from dept d;
    1. When I provide this statement with SQL*Plus
    (unfortunately 9.0.1.3.0) then I get the
    following output:
    XML()
    XMLTYPE()
    XMLTYPE()
    XMLTYPE()
    XMLTYPE()
    2. When I provide this statement with SQL Navigator
    4.3.0.456 then I get the following error:
    [1]: (Error): OCI-21560: argument 3 is null, invalid,
    or out of range
    3. When I execute the following PL/SQL-Code then I get
    the XML-Error message:
    DECLARE
    x CLOB;
    xmlstr VARCHAR2(32767);
    line VARCHAR2(2000);
    BEGIN
    x := dbms_xmlquery.getxml('select xmlElement("DEPARTMENT",
    xmlAttributes(d.deptno as "DEPTNO"),
    xmlElement("DNAME", d.dname),
    xmlElement("LOC", d.loc),
    xmlElement("EMPLOYEELIST",
    (select xmlAgg(xmlElement("EMPLOYEE",
    xmlAttributes(e.empno as "EMPNO"),
    xmlForest(e.ename as "ENAME",
    e.job as "JOB",
    e.hiredate as "HIREDATE",
    e.sal as "SAL",
    e.comm as "COMM",
    m.empno as "MGRNO",
    m.ename as "MGRNAME"
    from emp e, emp m
    where e.deptno = d.deptno
    and m.empno = e.mgr
    ) as XML
    from dept d');
    xmlstr := dbms_lob.SUBSTR(x,32767);
    LOOP
    EXIT WHEN xmlstr IS NULL;
    line := SUBSTR(xmlstr,1,INSTR(xmlstr,CHR(10))-1);
    DBMS_OUTPUT.PUT_LINE(line);
    xmlstr := SUBSTR(xmlstr,INSTR(xmlstr,CHR(10))+1);
    END LOOP;
    END;
    <?xml version = '1.0'?>
    <ERROR>oracle.xml.sql.OracleXMLSQLException: Unimplemented Feature</ERROR>
    4. When I provide the following PL/SQL-Code then I get the same xml-error:
    DECLARE
    x CLOB;
    xmlstr VARCHAR2(32767);
    line VARCHAR2(2000);
    BEGIN
    x := dbms_xmlquery.getxml('select xmlElement("SYSDATE", xmlElement("Datum", to_char(sysdate,''DD.MM.YYYY'')),
    xmlElement("Zeit", to_char(sysdate,''HH24:MI:SS''))) as XML
    from dual');
    xmlstr := dbms_lob.SUBSTR(x,32767);
    LOOP
    EXIT WHEN xmlstr IS NULL;
    line := SUBSTR(xmlstr,1,INSTR(xmlstr,CHR(10))-1);
    DBMS_OUTPUT.PUT_LINE(line);
    xmlstr := SUBSTR(xmlstr,INSTR(xmlstr,CHR(10))+1);
    END LOOP;
    END;
    <?xml version = '1.0'?>
    <ERROR>oracle.xml.sql.OracleXMLSQLException: Unimplemented Feature</ERROR>
    Can I generate the needed XML-Output from Database with SQL or PL/SQL?
    Can anybody help me?
    Regards
    Leonid Pavlov

    I have this done with:
    DECLARE
    qryCtx DBMS_XMLGEN.ctxHandle;
    result CLOB;
    xmlstr VARCHAR2(32767);
    line VARCHAR2(2000);
    BEGIN
    qryCtx := dbms_xmlquery.newContext('select deptno, dname, loc, cursor(select e.empno, e.ename, e.job,
    to_char(e.hiredate,''DD.MM.YYYY'') hiredate, e.sal, e.comm,
    m.empno MGRNO, m.ename MGRNAME
    from emp e, emp m
    where e.deptno = dept.deptno
    and m.empno(+) = e.mgr) emp
    from dept');
    dbms_xmlquery.useNullAttributeIndicator(qryCtx, FALSE);
    dbms_xmlquery.setRowsetTag(qryCtx, 'DEPARTMENTS_EMPLOYEES');
    dbms_xmlquery.setrowtag(qryCtx, 'DEPARTMENT');
    DBMS_XMLQuery.setRowIdAttrName(qryCtx, 'ID');
    DBMS_XMLQuery.setRowIdAttrValue(qryCtx, 'DEPTNO');
    -- dbms_xmlquery.setrowidattrname(qryCtx, NULL);
    result := dbms_xmlquery.getXML(qryCtx);
    DBMS_XMLQuery.closeContext(qryCtx);
    xmlstr := dbms_lob.SUBSTR(result,32767);
    LOOP
    EXIT WHEN xmlstr IS NULL;
    line := SUBSTR(xmlstr,1,INSTR(xmlstr,CHR(10))-1);
    DBMS_OUTPUT.PUT_LINE(line);
    xmlstr := SUBSTR(xmlstr,INSTR(xmlstr,CHR(10))+1);
    END LOOP;
    END;
    But how can I rename the <EMP>-Element to Employees?

  • XML output summary information how to print only once ? ( oracle 9.2 db )

    Hi,
    I am having following SQL
    select xmlelement("Emp",
    xmlforest('testing' "Type"),
    xmlagg(xmlelement("Transaction", xmlforest(empno "Number",
    ename "Name",
    sal "Sal")
    .extract('/*')
    from emp, ( select count(*) totcount, sum(sal) totsal
    from emp ) x1
    It is giving me following output
    <Emp>
    <Type>testing</Type>
    <Transaction>
    <Number>7369</Number>
    <Name>SMITH</Name>
    <Sal>800</Sal>
    </Transaction>
    <Transaction>
    <Number>7499</Number>
    <Name>ALLEN</Name>
    <Sal>1600</Sal>
    </Transaction>
    I want to print totcount, totalsalary ...etc at starting of XML output
    My Desired output
    <Emp>
    <Type>testing</Type>
    <Recs>10</Recs> =>
    <TotSal>10000</TotSal> =>
    <Transaction>
    <Number>7369</Number>
    <Name>SMITH</Name>
    <Sal>800</Sal>
    </Transaction>
    <Transaction>
    <Number>7499</Number>
    <Name>ALLEN</Name>
    <Sal>1600</Sal>
    </Transaction>
    How to do this ? If I change my SQL to
    xmlforest('testing' "Type", totcount "Recs"),
    I am getting following error
    ERROR at line 2:
    ORA-00937: not a single-group group function
    Kindly suggest me urgently.
    thanks & regards
    PJP

    Guys any idea on this? I am in very much in need of this solution. Please suggest me .
    Thanks
    Rao

Maybe you are looking for