Reg: PIVOTing XML -

Hi Experts,
I'm going through this nice article on PIVOT but the PIVOT XML doesn't seem to work as demonstrated.
ORACLE-BASE - PIVOT and UNPIVOT Operators in Oracle Database 11g Release 1
ranit@XE11GR2>> ed
Wrote file c:\rb\1.sql
  1  select * from (
  2     select product_code --customer_id, quantity,
  3     from pivot_test
  4  ) PIVOT (
  5     COUNT(product_code) as prod
  6             FOR(product_code) in ('A','B','C')
  7* )
ranit@XE11GR2>> /
  'A'_PROD   'B'_PROD   'C'_PROD
         4          2          3
Elapsed: 00:00:00.01
ranit@XE11GR2>> ed
Wrote file c:\rb\1.sql
  1  select * from (
  2     select product_code --customer_id, quantity,
  3     from pivot_test
  4  ) PIVOT XML (
  5     COUNT(product_code) as prod
  6             FOR(product_code) in ('A','B','C')
  7* )
ranit@XE11GR2>> /
                FOR(product_code) in ('A','B','C')
ERROR at line 6:
ORA-00905: missing keyword
Does it mean: hard-coded values can't at all be used inside the IN clause (and always it should be a sub-query) ?
Any pointers? Help is much appreciated.
Oracle version: Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production
Thanks,
Ranit

Hi, Ranit.
Review the documentation for PIVOT XML in the SQL Language manual:
SELECT
which says "You cannot specify XML when you specify explicit pivot values using expressions in the pivot_in_clause."
Notice that none of the XML examples on the Oracle-Base page are like the one you posted.  I find Oracle-Base a little misleading when it says "Adding the XML keyword to the PIVOT operator allows us to convert the generated pivot results to XML format. It also makes the PIVOT a little more flexible, allowing us to replace the hard coded IN clause with a subquery, or the ANY wildcard."
The XML keyword is actually requiring us to replace the hard coded IN clause.

Similar Messages

  • Reg : Weather XML Feed service application - urgent please.....!

    Hi All,
    I hv created a sample weather application which was published in weblog by Prakash with topic "Create a weather magnet using xml feed from weather.com"
    Everything works fine....But, when I deploy this one I get foll. error :
    Portal Runtime Error
    An exception occurred while processing a request for :
    iView : com.ust.weather.display
    Component Name : com.ust.weather.display
    xoap.weather.com.
    Exception id: 04:16_03/03/07_0773_1198650
    See the details for the exception ID in the log file
    I donno where iam going wrong but still.....not able to figure-out exact problem.
    I also, added the foll. jars :
                com.sap.portal.runtime.application.contentconversion_api.jar
                com.sap.portal.runtime.application.contentconverter_api.jar
    I request you all gurus.....plz provide me with solution where I went wrong.
    Appreciate your time and valuable inputs.
    Thanks in advance,
    Ravi Kumar.

    Hi Swathi,
    Thanks for your valuable inputs and reply.
    I checked in Javadeveloper >> Tools >>> Logviewer.
    I don;t find logviewer option under Tools of Java developer role.
    I am rightnow logged in to server via remote server desktop...checking for the logfiles.
    Please, let me know any other options/suggestions.
    Regards,
    Ravi Kumar.

  • Reg : SXMSMSTAT ( XML message Status Master )

    Hello Experts,
    There is a maintenance view for SXMSMSTAT ,
    Is it advisable to change the Status Description and the ICON For same  ?
    Only Description and ICON 
    what would be the impact on standard Monitoring of the xml messages
    Edited by: Anup Deshmukh on Aug 9, 2011 7:41 AM

    Still  waiting for  inputs,
    hello guys i won't change any Tech. Attributes of the table i will only be changing the contains of the same i e Description and the icon ...!
    I think it should not be any problem .
    What are your Views for the same

  • Reg: Port - XML HTTP

    Hi All
    Our Client  is sending data from SAP to Non SAP Through IDOC Using XML HTTP port .
    IDoc is a custom idoc.
    Out bound idoc is generating and posting to Non sap system .. no issues...But idoc is generating with 30 Status even though
    in Partner profile  we marked as Trigger idoc immedeatley.  Client can use RSEOUT00 to post idoc by scheduling the Job.
    Question is that....using XML HTTP port if an idoc is posted can we Trigger idoc immedeatley ???
    Thanks
    Ram

    Hi Anirban,
      Follow the below links for troubleshooting.
    Troubleshooting  File-to-IDOC Scenario in XI.
    The specified item was not found.
    Regards,
    Leela

  • Reg:Integrating XML Publisher and OA Framework

    I am trying to Integrating XML Publisher and OA Framework, i got
    C:\Framework\Jdeveloper\jdevhome\jdev\myprojects\xxxmlrep\oracle\apps\ak\webui\EmpCO.java
    Error(84,7): class OADBTransactionImpl not found in class xxxmlrep.oracle.apps.ak.webui.EmpCO
    Error(87,7): class OADBTransactionImpl not found in class xxxmlrep.oracle.apps.ak.webui.EmpCO
    Error(88,7): class OADBTransactionImpl not found in class xxxmlrep.oracle.apps.ak.webui.EmpCO
    Error(90,5): variable TemplateHelper not found in class xxxmlrep.oracle.apps.ak.webui.EmpCO
    Error(83,5): variable TemplateHelper not found in class xxxmlrep.oracle.apps.ak.webui.EmpCO
    source code is
    /*===========================================================================+
    | Copyright (c) 2001, 2005 Oracle Corporation, Redwood Shores, CA, USA |
    | All rights reserved. |
    +===========================================================================+
    | HISTORY |
    +===========================================================================*/
    package xxxmlrep.oracle.apps.ak.webui;
    import java.io.ByteArrayInputStream;
    import java.io.ByteArrayOutputStream;
    import javax.servlet.ServletOutputStream;
    import javax.servlet.http.HttpServletResponse;
    import oracle.apps.fnd.common.VersionInfo;
    import oracle.apps.fnd.framework.OAException;
    import oracle.apps.fnd.framework.server.OAApplicationModuleImpl;
    import oracle.apps.fnd.framework.webui.OAControllerImpl;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    import oracle.cabo.ui.data.DataObject;
    import oracle.xml.parser.v2.XMLNode;
    * Controller for ...
    public class EmpCO extends OAControllerImpl
    private static final int DEPTH = 4;
    private static final int APP_ID = 20035;
    private static final String APP_NAME = "AK";
    private static final String TEMPLATE_CODE = "XXEMP_JDEV";
    private static final int BUFFER_SIZE = 32000;
    public static final String RCS_ID="$Header$";
    public static final boolean RCS_ID_RECORDED =
    VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
    * Layout and page setup logic for a region.
    * @param pageContext the current OA page context
    * @param webBean the web bean corresponding to the region
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    OAApplicationModuleImpl am= (OAApplicationModuleImpl)pageContext.getApplicationModule(webBean);
    am.invokeMethod("initEmpVO");
    am.invokeMethod("getEmpDataXML");
    * Procedure to handle form submissions for form elements in
    * a region.
    * @param pageContext the current OA page context
    * @param webBean the web bean corresponding to the region
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    OAApplicationModuleImpl am= (OAApplicationModuleImpl)pageContext.getApplicationModule(webBean);
    String event = pageContext.getParameter("event");
    if("GenerateReport".equals(event))
    DataObject sessionDictionary = (DataObject)pageContext.getNamedDataObject("_SessionParameters");
    HttpServletResponse response = (HttpServletResponse)sessionDictionary.selectValue(null,"HttpServletResponse");
    try {
    ServletOutputStream os = response.getOutputStream();
    String contentDisposition = "attachment;filename=EmpReport.pdf";
    response.setHeader("Content-Disposition",contentDisposition);
    response.setContentType("application/pdf");
    XMLNode xmlNode = (XMLNode) am.invokeMethod("getEmpAM");
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    xmlNode.print(outputStream);
    ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
    ByteArrayOutputStream pdfFile = new ByteArrayOutputStream();
    TemplateHelper.processTemplate(
    ((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getAppsContext(),
    APP_NAME,
    TEMPLATE_CODE,
    ((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getLanguage(),
    ((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getCountry(),
    inputStream,
    TemplateHelper.OUTPUT_TYPE_PDF,
    null,
    pdfFile);
    byte[] b = pdfFile.toByteArray();
    response.setContentLength(b.length);
    os.write(b, 0, b.length);
    os.flush();
    os.close();
    catch(Exception e)
    response.setContentType("text/html");
    throw new OAException(e.getMessage(), OAException.ERROR);
    pageContext.setDocumentRendered(false);
    thank in advance
    }

    User,
    This code snippet may help:
    while (myQuestionIsAboutOAFramework)
        user.askQuestionInProperForum(Constants.OAFrameworkForum);
    public class Constants
       public static string OAFrameworkForum = "http://forums.oracle.com/forums/forum.jspa?forumID=210";
    }John

  • Reg'ding XML

    hi users,
    I have an XML File. When i read the XML File using DOM Parserm, I'm getting an the Following Exception
    Exception in thread "main" java.net.MalformedURLException: unknown protocol: c
    May i know the solution for this Exception
    Regards.,
    Babu

    Darryl.Burke wrote:
    Yes, and you replied to my post before I could edit it to "never mind" ;-)
    Thanks for the confirmation, I was a little vague on that one.
    But does anyone know why the file protocol has an extra slash when compared to all the other protocols I know of? It would be interesting to know.
    dbYou can find a discussion on this here
    http://lists.freedesktop.org/archives/xdg/2004-November/003715.html

  • REG: WRITE XML STRING INTO XML FILE

    Hi All, I have a XML FILE on PC. I get a xml string from my server.
    My Task: I want to append the xml string coming from the server into the existing xml file at a particular Node. Given below is my code :
    String xmlString = baos.toString();
                      DocumentBuilder db4XMLString = docBuilderFactory.newDocumentBuilder();
                      InputSource inStream = new InputSource();
                      inStream.setCharacterStream(new StringReader(xmlString));
                      Document doc4XMLString = db4XMLString.parse(inStream);
                      Node root4XMLString = doc4XMLString.getElementsByTagName("epg").item(0);
                      doc.appendChild(doc.importNode(root4XMLString, true));
                      File file = new File(Constant.XMLFILEPATH);
                      Result result = new StreamResult(file.toURI().getPath());
                      Source source = new DOMSource(doc);
                      Transformer xformer = TransformerFactory.newInstance().newTransformer();
                      xformer.transform(source, result);But, wen i run my application I get following exception:
    The markup in the document following the root element must be well-formed.
    org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed.
    at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
    Is that my XML string is not well formed. Is it so then please let me how to convert my xml string into well formed XML data.
    Please help me out.
    Thanking You.

    There are many reasons why xmlString could be not well formed. There is no magic recipe for making it well formed: just look at it and see why it is not parseable.
    Note that this line:
    String xmlString = baos.toString();can be problematic if you have non ASCII-7 characters in your XML document. baos could then contain a byte representation of these characters in one particular encoding, but, since you use the .toString() method that relies on the default encoding of your system, you can end up with a mismatch and garbage in your XML.

  • Reg  ExchangeProfile.xml

    Hello guys,
                Now i am doing XI installation by the help of XI Installation guide. But when i am login with J2EE_ADMIN ->Choose connection -> Server Settings, enter the hostname etc. and user is XILDUSER
    Then click on Import and Import the file.
    In that path with in the global folder exchangeprofile.xml is not there.
    what can i do.I stopped config in this step. Wheather was i made any mistake..
    Pls give me that solution
    Regards
    Velu

    HI,
    Did you check this thread-
    Profile check
    SAP Note-851251,848950
    Hope this helps,
    Regards,
    Moorthy

  • Using XML PIVOT clause in SQL to generate crosstab report BI Pub. Possible?

    I am trying to use the XML version of the Pivot Clause in an SQL query to generate the SQL needed for a cross tabular or Pivot report in BI Publisher. How can I use the output (e.g. below) in BI publisher as the SQL query? It is ignoring the XML column when I view the output in BI. IS this possible and has anyone tried this?
    for example
    SQL> SELECT *
    2 FROM (
    3 SELECT deptno, job, sal
    4 FROM emp
    5 )
    6 PIVOT XML
    7 (SUM(sal) FOR deptno IN (ANY));
    JOB DEPTNO_XML
    ANALYST <PivotSet><item><column name = "DEPTNO">20</column><column name = "SUM(SAL)
    ">6600</column></item></PivotSet>
    CLERK <PivotSet><item><column name = "DEPTNO">10</column><column name = "SUM(SAL)
    ">1430</column></item><item><column name = "DEPTNO">20</column><column name
    = "SUM(SAL)">2090</column></item><item><column name = "DEPTNO">30</column>
    <column name = "SUM(SAL)">1045</column></item></PivotSet>
    MANAGER <PivotSet><item><column name = "DEPTNO">10</column><column name = "SUM(SAL)
    ">2695</column></item><item><column name = "DEPTNO">20</column><column name
    = "SUM(SAL)">3272.5</column></item><item><column name = "DEPTNO">30</colum
    n><column name = "SUM(SAL)">3135</column></item></PivotSet>
    PRESIDENT <PivotSet><item><column name = "DEPTNO">10</column><column name = "SUM(SAL)
    ">5500</column></item></PivotSet>
    SALESMAN <PivotSet><item><column name = "DEPTNO">30</column><column name = "SUM(SAL)
    ">6160</column></item></PivotSet>
    thanks
    Paul P

    Sorry Sunder, you're going to have to work a little harder to get points! I know how the PIVOT clause and all its options work so I don't need documentation on just the SQL. Its how it works in BI that I'm interested in.
    I want to use the XML option in the PIVOT clause as I don't want to hard code the crosstab columns. (see my code in the original posting)
    I want to know if BI Publisher is able to read the output of the script when creating a report based on an SQL query and generate something that actually looks a crosstab rather than a column of XML. I want my report in BI to look something like the output below. (Sorry about output. I can't get fixed width font working on this forum).
    PRODUCT INTERNET_Q1 INTERNET_Q4 PARTNERS_Q2
    Bounce 347 632 954
    Smash Up Boxing 129 280 560
    Comic Book Heroes 47 155 275
    thanks
    Paul P

  • How to Handle Dynamic Pivoting with a single SQL?

    I was searching for a single SQL who can dynamically understands the pivoting members in the data, I saw several ways of doing Pivoting depending on the version, some are really hard to understand but just two options upto now seams to be flexable enough to do dynamic pivoting, right?
    1- For this option you have to write PL/SQL block to build up the dynamic single SQL query, I also find this approach very easy to understand. :)
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::NO::P11_QUESTION_ID:766825833740
    2- 11.1 's PIVOT new feature with PIVOT XML and ANY clause, a SINGLE SQL and easy to understand but returns XMLTYPE data, another step to parse to produce the report is needed.
    http://www.oracle-developer.net/display.php?id=506
    Below is a 10g Model Clause example, but here instead of pivoting by A1-A2-A3 staticly I want to have these values by a distinc subquery for example;
    create table test(id varchar2(2), des varchar2(4), t number);
    INSERT INTO test values('A','a1',12);
    INSERT INTO test values('A','a2',3);
    INSERT INTO test values('A','a3',1);
    INSERT INTO test values('B','a1',10);
    INSERT INTO test values('B','a2',23);
    INSERT INTO test values('C','a3',45);
    commit;
    SELECT * FROM test;
    ID DES T
    A a1 12
    A a2 3
    A a3 1
    B a1 10
    B a2 23
    C a3 45
    select distinct i, A1, A2, A3
    from test c
    model
    ignore nav
    dimension by(c.id i,c.des d)
    measures(c.t t, 0 A1, 0 A2, 0 A3)
    rules(
    A1[any,any] = t[cv(i),d = 'a1'],
    A2[any,any] = t[cv(i),d = 'a2'],
    A3[any,any] = t[cv(i),d = 'a3']
    I A1 A2 A3
    C 0 0 45
    B 10 23 0
    A 12 3 1 Any advice is appreciated, thank you.

    Hi,
    You can do dynamic SQL in SQL*Plus, also.
    [Thid thread|http://forums.oracle.com/forums/thread.jspa?messageID=2744039&#2744039] shows how to pivot a table with a dynamic number of columns.

  • Pivot query probelm

    Hi, I am trying to do a pivot report, first I did a simple pivot hard-coding the columns that I was about to use but, it is not convenient so I was asked to do a dynamic report where the columns were selected by a sub-query so I  followed the solution from this post
    Pivot query using XML option in APEX , but I get this error  ORA-00932: inconsistent datatypes: expected - got CLOB, now I know that by default that query is set to return CLOB, but the thing is that when I specify the return value to varchar2 my browser freezes and I cannot go any further than that I need to reboot my browser, I'm using Oracle 11g and APEX 3.2.1 here is my query
    SELECT
         xmlserialize(CONTENT DEPARTMENT_XML as varchar2(4000)) XML
    FROM
                SELECT
                   DEPARTMENT,
                   S_GROUP AS "S GROUP",
                   S_GROUP
                FROM   MYTABLE  where PER = 'BNA' and department not like 'SI%'  
       PIVOT XML(
                   COUNT(S_GROUP)
                   FOR DEPARTMENT      
                   IN  (select distinct department from MYTABLE )          )
    ORDER BY 1
    Thank you.

    Because execuitng the query without the
    ROW_NUMBER gives the results in milliseconds
    but the row_number takes it 7+ min.I think you mean that executing the query without ROW_NUMBER gives the first rows in milliseconds. However, if you wait until the last row, you may find that it takes several minutes as well. If this is not the case, please post some more details.
    And, as BluShadow already said, an additional ordering takes some time, so it will be a little slower, but probably not this much. If you really want to know where time is being spent, then I suggest to take a look at [url http://forums.oracle.com/forums/thread.jspa?threadID=501834&tstart=0]this thread, and start measuring.
    Regards,
    Rob.

  • 11g PIVOT uses static columns - why why why???

    I am very curios to know why we have to hard-code the "pivot in" clause in a pivot query. Does this not defeat the purpose of pivoting?
    we have to write this:
    SELECT *
    FROM (SELECT customer_id, product_code, quantity
    FROM pivot_test)
    PIVOT (SUM(quantity) AS sum_quantity FOR (product_code) IN ('A' AS a, 'B' AS b, 'C' AS c))
    ORDER BY customer_id;
    Why can we not put a subquery in the "IN" clause? Or even better, leave it blank to indicate we are pivoting for all.
    I know you can do something like this with the PIVOT XML function, but I want columns in the result, not XML. And I also do not want to build the query as a string and execute it like that, it gets really messy and I feel sorry for the next bloke who needs to take over from me.
    Does anybody know why this seems to not be possible for ORACLE?
    Thanks all.

    In addition to the excellent relational theory reasons the SQL standard (and relational database vendors) can't do dynamic pivots, there are important practical problems.
    Every API that interacts with any database (ODBC, JDBC, ODP.Net, ADO, DAO, OLE DB, OO4O, etc.) goes through a series of steps in order to execute a SQL statement.
    1) The statement is prepared.
    2) The bind variables are bound and return variables are created
    3) The statement is executed.
    Preparing the statement involves the database parsing the query (but not executing it). This provides the client with a statement handle that can be interrogated to, for example, describe the result set to expect. This allows the client to determine that, for example, a query is going to return 5 columns, the first of which is an integer and the next 4 of which are VARCHAR2(100)'s. The client then knows what data structures it needs to allocate. Since this statement handle is potentially going to be cached and reused many times with many different sets of bind variables, the structure of the result needs to be fixed.
    If a database permitted the structure of the query to change because data changed, it would cause massive havoc across every application that interacted with the database. You'd have to add something to every database API that allowed the database to come back from an attempt to execute a query and say "hey, I know I told you a while ago that this query was going to return 5 columns-- turns out, now it returns 6 (or 4 or 17)". Tons of code that relies on these APIs would need to be rewritten to be able to handle that exception, discard the cached handles, reallocate the data structures, re-execute the query, and figure out what, if any, downstream impacts that has on the application code. That would be a massive undertaking and would create much more work than would be saved by allowing a dynamic pivot.
    Justin

  • Missing expression Error using pivot function

    Hi,
    When i am running the query:
    The query needs to display name and total:
    {select  *}
    {  from  (select name,nvl(sal,0) tot from tablea }
    {                          GROUP BY name,nvl(sal,0) }
    {  pivot(SUM(tot) for name in (select ltrim(sys_connect_by_path(''''||name||'''', ','), ',') str}
    {from ( select row_number() over(order by name) rn}
    {       ,      name}
    {       from  tablea}
    {where connect_by_isleaf=1}
    {start with rn=1}
    {connect by rn=prior rn+1);}
    When running the above query its giving error:
    ORA-00936: missing expression at line select ltrim(sys_connect_by_path
    Any help will be needful for me

    If you use pivot, you have to hardcode all your values in the FOR IN clause.
    SQL> select *
      2   from (select ename,nvl(sal,0) tot from emp
      3   GROUP BY ename,nvl(sal,0)
      4   )
      5   pivot(SUM(tot) for ename in ( 'SCOTT' ,'KING') )
      6  ;
       'SCOTT'     'KING'
          3000       5000You can't substitute the literal list of values (in my example ('SCOTT','KING') with a subquery producing similar result.
    Only with pivot xml you can put there a subquery, in that case, the result however doesn't have to be in form of comma separated values (like you try to achieve with sys_connect_by_path)
    SQL> select *
      2   from (select ename,nvl(sal,0) tot from emp
      3   GROUP BY ename,nvl(sal,0)
      4   )
      5   pivot xml (SUM(tot) for ename in ( select ename from emp where ename like 'S%' ) )
      6  ;
    ENAME_XML
    <PivotSet><item><column name = "ENAME">SCOTT</column><column name = "SUM(TOT)">3000</column></item><
    item><column name = "ENAME">SMITH</column><column name = "SUM(TOT)">800</column></item></PivotSet>Best regards
    Maxim

  • PIVOT Statement - ORA-00936

    I have a question about a PIVOT Statement
    DB: 11.2.0.3.0
    I have Table x with 3 Columns (c1,c2,c3)
    C1 C2 C3
    A | T | 1
    A | P | 1
    M | S | 1
    D | T | 1
    D | P | 1
    D | D | 1
    with this select the result is ok
    SELECT * FROM
    (SELECT c1, c2, c3 FROM x)
    PIVOT
    max(c3)
    FOR c2
    IN ('T', 'P', 'D', 'S')
    ORDER BY c1;
    gives me the correct result (is malformed in this Forum !)
    C1 'T' 'P' 'D' 'S'
    A 1 1
    D 1 1 1
    M 1
    but thies Select give me ORA-00936: missing expression
    SELECT * FROM
    (SELECT c1, c2, c3 FROM x)
    PIVOT
    max(c3)
    FOR c2
    IN (select distinct c2 from x )
    ORDER BY c1;
    is the used statment "*select distinct c2 from x*" not allowed in this IN Clause ?
    alfred

    alinzenb wrote:
    is the used statment "*select distinct c2 from x*" not allowed in this IN Clause ?
    alfredNo..
    You cannot use subquery here..
    For completely dynamic pivoting - check FAQ: {message:id=9360005} It is explained under the heading - Dynamic Pivoting.
    And if you use PIVOT XML, you can have a subquery.. You will get an XML output..
    Edited by: jeneesh on Apr 4, 2013 12:27 PM

  • Question using pivot

    I am very new  at using the pivot command in Oracle. I have a query and I am using the  pivot xml example because I am pivoting an unknown domain of values.  I am trying to use this query in Application Express the xml formatting is put all into one column. APEX  can not format the XML. Below is my query. Is there another way to pivot against unknown domain values. We are on 11.2.3 version of database.
    Thanks,
    Pam
    select * from (select country,item, prod_y.nutrients, form_rev,label_rev,batch_number,daycode,weight from prod_mstr,
    (select nutrients from prod_mstr where trim(label_rev)='6/12' and trim(country) = 'US' AND trim(item)='1025' and master ='Y') prod_y
    where TRIM(label_rev)='6/12' and trim(country) = 'US' AND trim(item)='1025' and master ='N'
    AND prod_y.nutrients(+) = prod_mstr.nutrients )
    PIVOT XML (sum(weight) for nutrients IN (select Nutrients nut from prod_mstr where trim(item) = :P_ITEM and trim(country) = :P_COU and master = 'Y'));

    Perhaps these threads might help:
    https://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2648932900346131308
    https://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:766825833740

Maybe you are looking for

  • My ipod works in itunes but does not appear in "my computer" after I changed the properties

    My ipod works in itunes but does not appear in "my computer" after I changed the properties. First off, I'm using Windows XP (and Mac SnowLeopard) Here's how it started. For some reason my ipod started showing up as a camera when I plugged it in. It

  • UPDATE statement not working when updating Z table

    Hi I have declared Ztable with fields MANDT, VKORG, VBELN, IDENTCODE and POSNR as key fields, other fields are FKDAT,KUNNR, NETWR, WAERK, SKFBP First I got the data from presentation server and moved into internal table 'A' and after that declared in

  • Data Merging in InDesign 5.5

    Hello, I would like to use data merge in InDesign but unfortunately it seems to be missing some essential functions. One function I would like to be able use is creating single PDFs naming them using a column that is in the CSV file. Does anyone know

  • Stuck updating apps and no access to interent even though connected

    can someone help!! i have ipod touch - that tells me it is connect to wi-fi but will not open any pages also have updated some apps and they have got stuck and cant delete them!! have restore network setting but still the same

  • Canon 5D Mark II

    I am trying to edit RAW footage from the Canon 5D Mark II with FCE. In original form, the footage is H.264, mov. This format needs a serious amount of time to render with every placement and change on the timeline. This is not conducive to editing an