SQL query syntax error .......

I am using following query
SELECT PERNR VORNA NACHN GBDAT FROM PA0002
    INTO CORRESPONDING FIELDS OF TABLE ITAB
    WHERE UPPER( VORNA )  = UPPER( STRU_USERIP-VORNA )
    AND   ENDDA >= SY-DATUM
    AND   BEGDA <= SY-DATUM .
and I am geting syntax error as --
vorna is   not valid comparison operator .
can anyone plz suggest me solution over this problem .

Logic must be written,
The below logic is incomplete
Break your head and modify it
TABLES:pa0002.
DATA:itab TYPE TABLE OF pa0002.
DATA:wa TYPE pa0002.
DATA:lv_vorna TYPE pa0002-vorna.
DATA:ra_vorna TYPE RANGE OF pa0002-vorna.
DATA:wa_vorna LIKE LINE OF ra_vorna .
DATA:lv_index TYPE i.
DATA:offset TYPE i.
DATA:pa_vorna TYPE pa0002-vorna VALUE 'Frank'.
DATA:len TYPE i.
len = STRLEN( pa_vorna ).
MOVE pa_vorna TO lv_vorna.
TRANSLATE lv_vorna TO LOWER CASE.
wa_vorna-low = lv_vorna.
APPEND wa_vorna TO ra_vorna.
MOVE pa_vorna TO lv_vorna.
TRANSLATE lv_vorna TO UPPER CASE.
wa_vorna-low = lv_vorna.
APPEND wa_vorna TO ra_vorna.
wa_vorna-low = PA_VORNA.
APPEND wa_vorna TO ra_vorna.
TRANSLATE PA_VORNA TO LOWER CASE.
DO len TIMES.
  lv_index = sy-index - 1.
  offset = lv_index + 1.
  DO len TIMES.
    MOVE pa_vorna TO lv_vorna.
    TRANSLATE lv_vorna+lv_index(offset) TO UPPER CASE.
    wa_vorna-low = lv_vorna.
    APPEND wa_vorna TO ra_vorna.
    ADD 1 TO lv_index.
  ENDDO.
ENDDO.

Similar Messages

  • MySQL InnerJoin query syntax error?

    I can't seem to locate the syntax error in this MySQL query.  Coldfusion says there an error in my sql syntax.  Here is the query.  Anyone have any clues on this?
    <cfquery name="queryItem" datasource="bonus">
    select
    p.productid,
    p.modelnumber,
    p.modeldescription,
    sp.sp_bonusamount as Amount
    from
    products i join bonusproducts sp on i productid = sp.sp_productid
    inner join program p on sp.sp_programid = p.programid
    where
    p.CompanyOrgLevelID in (#getParentCompanyOrgLevelIDList(session.CompanyOrgLevelID)#)
    and p.ProgramID = #programID#
    <cfif categoryID gt 0>
    and CategoryID in (#getSubcategoryIDList(categoryID)#)
    </cfif>
    order by
    #sortColumn# #sortDirection#
    </cfquery>

    To troubleshoot, run this:
    select
    p.productid,
    p.modelnumber,
    p.modeldescription,
    sp.sp_bonusamount as Amount
    from
    products i join bonusproducts sp on i productid = sp.sp_productid
    inner join program p on sp.sp_programid = p.programid
    where 1 = 2
    If it runs successfully, keep adding bits and pieces until it crashes.  Then you'll know what made it crash.
    Also enable debugging so you can see the sql that gets generated from your code.   That's often useful.

  • Select-options in SELECT query - syntax error

    Hi all,
      I get the error below when I try to use the select options in a SELECT query . Please help me.
    "The IN operator with "SO_AWART" is followed neither by an internal
    table nor by a value list."
    The code i have used(Logical database  PNP is used):
    TABLES: pernr,
            catsdb.
    INCLUDE ztime_cwtr_top.    " global Data
    INCLUDE ztime_cwtr_f01.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
    SELECT-OPTIONS SO_AWART FOR CATSDB-AWART.
    PARAMETERS P_THRES TYPE I.
    SELECTION-SCREEN END OF BLOCK B1.
    Get data from CATSDB table. Workdates within the date interval are considered.
      SELECT pernr workdate awart catsquantity beguz enduz status
      FROM catsdb
      INTO TABLE it_catsdb
      WHERE pernr  = pernr-pernr    AND
           workdate GE pn-begda     AND
           workdate LE pn-endda     AND
           status   IN ('20', '30') AND
           awart    IN  so_awart .
          awart    IN ('1100', '1137', '1138', '1139', '1140',
                      '1147', '1148', '1149', '1157', '2003' ).
    when I give the values directly i do not get any syntax error, but when I use select options in the where condition I get the syntax error.
    I have tried different options like using only the select-options in the where condition.
    Thanks in advance.....
    Madhu

    Solved.
    Code with syntax error:
    include z...top .
    include z...fo1.
    select-options: xxxxxxx
    Code  with no syntax error:
    select-options: xxxxxxx
    include z...top .
    include z...fo1.
    Thanks for all your help,
    Madhu

  • InfoSet Query: Syntax Error while generating the program.

    Dear All,
    I have a Query in CRM system which contains an Infoset based on LDB.
    The InfoSet Query throws up a Syntax error while generating the program.
    So, we are not able to change the Infoset using the Infoset Query through SQ01.
    The error is as follows:-
    Syntax error in program "AQZZ==/SAPQUERY/CRM_ACTMON1 ".
    Error in the ABAP Application Program
    The current ABAP program "CL_QUERY_OUTPUT_DEFINITION====CP" had to be
    terminated because it has
    come across a statement that unfortunately cannot be executed.
    The following syntax error occurred in program "AQZZ==/SAPQUERY/CRM_ACTMON1 "
    in include "AQZZ==/SAPQUERY/CRM_ACTMON1 " in
    line 28:
    ""CRMT_REPORT_LOCATORLIST" must be a flat structure. You cannot use int"
    "ernal tables, strings, references, or structures as components. -"
    Please help me arrive at an solution, so that we are able to change the Infoset through the InfoSet Query.
    Awaiting your reply as soon as possible.
    Thanks and Regards,
    Pankaj.

    There is an error in your query, specifically in the definition of CRMT_REPORT_LOCATORLIST. In the short dump (transaction ST22) you will see more details and the exact location of an error if you just scroll down.
    I can't tell more because this problem is specific to your system, to which I have no access. Read the whole dump and look at all the objects mentioned there.

  • Query syntax error after multiprovider change

    Hi everyone,
    I removed key figures from a multicube, changed a query on top afterwards and saved it. The key figures are no longer in the key figure list of the query in the Query designer, and are no longer used in any place within the query.
    Now, I'm getting a syntax error on query execution, since the compiled query still contains a reference to the old key figures. Regeneration via RSRT or saving under a new name doesn't work, and to delete the generated report I need a developer key.
    Any ideas?
    Regards,
    Tilman

    Hi Shashank,
    thanks for your response.
    I did try the "check query" button, it didn't return an error. When executing the query via rsrt, I get a dump due to "Syntax error in program GP48VM7K0MSF08DRO2382A2PSTI ". The program still contains data type references to the removed infoobjects. When checking the program via SE38, you get just that syntax error.
    I'm looking for a way to clean these things up. Even when creating a new query on the aggregation level (I was talking about a multiprovider earlier, which is located underneath), the error pops up. I activated all the objects along the way, with no effect.
    Regards,
    Tilman

  • Query syntax error

    Hi,
    I've a query for a report as below. I want distinct donor code whereas i have 2 or more customers with same name and i want to retrieve data of customers between specific donor codes.I've a syntax error where i give 'between' for the following syntax in the code
    DONOR_TAB.DONOR_CODE BETWEEN DONOR_TAB.DONOR_CODE=:p_code AND DONOR_TAB.DONOR_CODE=:p_code
    The following is the query:
    SELECT ALL INITCAP(TITLE_TAB.TITLE_NAME||' '||DONOR_TAB.FIRST_NAME||' '||DONOR_TAB.MIDDLE_NAME||' '||DONOR_TAB.LAST_NAME) donor_name,
    RTRIM(INITCAP(RPAD(DONOR_TAB.ADDRESS1, 35, ' ')||RPAD(DONOR_TAB.ADDRESS2, 35, ' ')||RPAD(DONOR_TAB.STREET, 30, ' '))) DISPLAY_COL2,
    INITCAP(CITY_MASTER_TAB.CITY_NAME||' - '||DONOR_TAB.PIN) DISPLAY_COL3,
    INITCAP(CITY_MASTER_TAB.STATE_NAME||', '||CITY_MASTER_TAB.COUNTRY_NAME) DISPLAY_COL4,
    UPPER('DONOR CODE'||' - '||CITY_MASTER_TAB.CITY_NAME||'/'||DONOR_TAB.DONOR_CODE) DISPLAY_COL5
    FROM DONOR_TAB, CITY_MASTER_TAB, TITLE_TAB, DONOR_PROG_TAB
    WHERE donor_tab.donor_code = donor_prog_tab.donor_code AND DONOR_TAB.CITY_CODE = CITY_MASTER_TAB.CITY_CODE
    AND DONOR_TAB.TITLE_CODE = TITLE_TAB.TITLE_CODE
    OR DONOR_TAB.DONOR_CODE = :p_code
    OR DONOR_TAB.DONOR_CODE BETWEEN DONOR_TAB.DONOR_CODE=:p_code AND DONOR_TAB.DONOR_CODE=:p_code
    OR DONOR_TAB.LANG = :P_LANG
    OR DONOR_TAB.REMINDER = :P_REMINDER
    ORDER BY DONOR_TAB.DONOR_CODE
    Can you help me as to how i rectify this error
    Thanks

    Syntax is like this
    DONOR_TAB.DONOR_CODE BETWEEN :p_code AND :p_code
    Note:
    You hav given initial and final values as same(p_code)

  • JDQL named query syntax error

    Hi,
    we have a syntax error in our JDOQL-namedQuery. We want to do a join over
    two tables "TestOrder" and "TestOrderPosition" and get this error:
    (we use Kodo 4.0)
    <?xml version="1.0"?>
    <jdoquery>
    <package name="salt.domain.orderservice.entity">
    <class name = "TestOrder">
         <query name="findByOrderId">select where
    testOrderPositions.contains(testOrderPosition) and
    testOrderPosition.description==:t variables
    salt.domain.orderservice.entity.TestOrderPosition testOrderPosition</query>
    </class>
    </package>
    </jdoquery>
    <4|false|4.0.0EA3> kodo.jdo.UserException: An error occurred while parsing the
    query filter "testOrderPositions.contains(testOrderPosition) and
    testOrderPosition.description==:t". Error message: The JDOQL string is not
    valid. Make sure all parentheses are matched and that you use proper Java
    syntax.
         kodo.query.AbstractExpressionBuilder.parseException(AbstractExpressionBuilder.java:92)
         kodo.query.jdoql.JDOQLExpressionBuilder.evalExpression(JDOQLExpressionBuilder.java:508)
         kodo.query.jdoql.JDOQLExpressionBuilder.eval(JDOQLExpressionBuilder.java:265)
         kodo.query.jdoql.JDOQLParser.eval(JDOQLParser.java:98)
         kodo.query.ExpressionStoreQuery$DataStoreExecutor.<init>(ExpressionStoreQuery.java:542)
         kodo.query.ExpressionStoreQuery.newDataStoreExecutor(ExpressionStoreQuery.java:154)
         kodo.query.QueryImpl.createExecutor(QueryImpl.java:807)
         kodo.query.QueryImpl.compileForDataStore(QueryImpl.java:741)
         kodo.query.QueryImpl.compileForExecutor(QueryImpl.java:721)
         kodo.query.QueryImpl.compile(QueryImpl.java:635)
         kodo.kernel.BrokerImpl.namedQuery(BrokerImpl.java:3681)
         kodo.kernel.DelegatingBroker.namedQuery(DelegatingBroker.java:1587)
         kodo.jdo.PersistenceManagerImpl.newNamedQuery(PersistenceManagerImpl.java:1028)
         salt.domain.orderservice.dao.jdo.JDOOrderRepositoryImpl.findOrderWithPositionById(JDOOrderRepositoryImpl.java:85)
         salt.domain.orderservice.OrderRepositoryImpl.findOrderWithPositions(OrderRepositoryImpl.java:91)
         salt.domain.orderservice.OrderServiceImpl.getOrderWithPosition(OrderServiceImpl.java:15)
         sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         java.lang.reflect.Method.invoke(Unknown Source)
         org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:335)
         org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
         org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
         org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
         org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
         org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
         $Proxy0.getOrderWithPosition(Unknown Source)
         salt.application.DddTestController.handleRequest(DddTestController.java:40)
         org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:44)
         org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:717)
         org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:658)
         org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:392)
         org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:347)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    Does anyone have an idea?
    Thanks,
    Ingo Schneider

    Thanks for your help! It works now!
    I have another problem with a very simple query:
    I always get a ClassCastException with the follwoing query. If I left the
    result parameter out the query works. Parameter "t" is an integer, but
    there shouldn't be any cast problems between integer and long.
    <?xml version="1.0"?>
    <jdoquery>
         <package name="salt.domain.orderservice.entity">
              <class name="TestOrder">
         <query name="findByOrderIdPosition">select idOrder where
    idOrder==:t</query>
    </class>
    </package>
    </jdoquery>
    public class TestOrder implements Serializable{
         private String description;
         private long idOrder;
         private Set testOrderPositions = new HashSet();
    getters & setters...
    java.lang.ClassCastException: java.lang.Long
         salt.domain.orderservice.dao.jdo.JDOOrderRepositoryImpl.findOrderWithPositionById(JDOOrderRepositoryImpl.java:99)
         salt.domain.orderservice.OrderRepositoryImpl.findOrderWithPositions(OrderRepositoryImpl.java:91)
         salt.domain.orderservice.OrderServiceImpl.getOrderWithPosition(OrderServiceImpl.java:15)
         sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         java.lang.reflect.Method.invoke(Unknown Source)
         org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:335)
         org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
         org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
         org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
         org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
         org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
         $Proxy0.getOrderWithPosition(Unknown Source)
         salt.application.DddTestController.handleRequest(DddTestController.java:40)
         org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:44)
         org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:717)
         org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:658)
         org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:392)
         org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:347)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    Thanks,
    Ingo Schneider

  • MDX query : Syntax error at token 'NONEMPTYMEMBER'

    Syntax error when executing this very simplified MDX query :
    WITH
    MEMBER [ANNEE].[YEAR1] AS
    NONEMPTYMEMBER FY10
    [FY10]
    MEMBER [ANNEE].[YEAR2] AS
    NONEMPTYMEMBER [FY10]
    [FY10]
    SELECT
    {[YEAR1],[YEAR2]} ON COLUMNS
    FROM [MICOPIGE.COM_MBU]
    Syntax error in input MDX query on line 9 at token 'NONEMPTYMEMBER'
    Note that line 9 "NONEMPTYMEMBER FY10" is a copy of line 4
    No error if I delete line 4
    Any help to understand and fix this error would be greatly appreciated.

    Precision : My goal is to reduce the 30mn duration of a complex MDX query with many calculated members, using the NONEMPTYMEMBER token.

  • MDX Query Syntax error

    I have a simple MDX query is shown in below:
    SELECT [Accounts].[pv] ON ROWS,
    [Reporting].Members ON COLUMNS
    FROM RoggeBSO.Db
    (please note that Accounts, pv and Reporting words are in square brackets)
    When I execute this query on the MDX Script Editor (in EAS), I get the following syntax error:
    Statement Executed with warnings.
    Syntax error in input MDX Query on line 1 at token 'ON'
    Unexpected Essbase error 1260052
    I tried this on both ASO & BSO cubes but didn't work. Could anyone help please?
    Regards
    Chandra
    Edited by: user2695091 on 22-Apr-2009 03:27

    SELECT {[Accounts].[pv]} ON ROWS,
    {[Reporting].Members} ON COLUMNS
    FROM RoggeBSO.Db

  • Display SQL query in error text

    Using CFMX 6.1.
    Is it possible to get our error handler page to display the
    SQL query that fails and causes an error?
    If tried #error.sql# but it doesn't exist after a db
    exception. If I put a cftry around a particular query and then use
    cfcatch.sql within a cfcatch tag pair, it works fine. But given our
    error handler page is for the entire site, I can't use cfcatch, at
    least not the way the site is currently architected. I was hoping
    error.sql would work since my quick ref quide states that "Any
    cfcatch variable that applies to exception type can be accessed
    within the Error scope. But then it doesn't list Error.SQL or
    CFCATCH.SQL for that matter in any documentation I've seen, yet the
    later works in cfcatch tags.
    Any help would be appreciated.

    You don't have to place a CFTRY/CFCATCH around each query. I
    don't know how many pages you have in your application, but you
    could do something like the following:
    1. Replace <body> with <body><CFTRY>
    2. Replace </body> with the following
    <CFCATCH TYPE="database">
    <CFMODULE TEMPLATE="customErrorPage.cfm"
    sqlStatement="#CFCATCH.Sql# " message="#CFCATCH.message#">
    </CFCATCH>
    </CFTRY>
    </body>
    You can use a global search-and-replace utility, such as
    SR32, to make this task painless. Click
    here to go to the SR32
    site.

  • SQL Query giving error in SAP B1 8.82 PL 09

    Hi all,
    Please check the query below.
    If we remove the Where condition from the Query it works fine.
    Otherwise it gives error. The error screen is also attached.
    [Microsoft][SQL Server Native Client 10.0][SQL Server]The data types ntext and
    ntext are incompatible in the equal to operator. 'Blanket Agreement'(OOAT)(OUQR)

    Dear Nagarajan K,
    First of all Thank You for prompt reply to my query.
    Select * from oinv T0 where T0.[DocDate] >=[%0] AND  T0.[DocDate] <=[%1]
    The issue with the above posted query is if you remove the filter conditions i.e where T0.[DocDate] >=[%0] AND  T0.[DocDate] <=[%1]
    The query works.
    Put the filter condition back and it gives eror:
    [Microsoft][SQL Server Native Client 10.0][SQL Server]The data types ntext and
    ntext are incompatible in the equal to operator. 'Blanket Agreement'(OOAT)(OUQR)
    What is possibly going wrong because data is there.

  • SQL Query Builder Error

    Hi,
    I'm trying to build a data model based on data on our server. I've created a Data Set in SQL using the Query Builder, but when I go to save, I receive this error message:      
    [Hyperion][SQLServer JDBC Driver][SQLServer]Invalid object name 'CMPROJ.DBO.ISDT'.
    Does this have anything to do with accessing my server? Any suggestions?
    Many Thanks.

    Sorry but this has nothing to do with this thread - aimed for questions around Oracle Communications Data Model, the Enterprise Data Warehouse for Telcos available as DB option.
    You might want to ask your question to the BIapps folks/Hyperion Thread. If still interested by "building" a data model for comms, you'd better save time and get something pre-built like OCDM...
    Regards
    Axel.

  • Highlight SQL query at error

    A feature I've come to rely on in Toad is that when I run a query and there is an error, the part of the code that caused the error will be highlighted. It's simple, and it's a big productivity boost. This feature is what's stopping me from using SQL Developer at this point. Are there plans to implement this?

    I second this comment!
    I do a lot of OWB development and I often validate results of the mapping directly in SQL (which are usually going on for 200-400 lines.
    In toad, executing the statement wit an error (usually a constant defined in OWB but represented in the intermediaet result by a "FULLPACKAGE.BlaBlaBla will bring the cursor directly at the line that errored. SQL Developer will only give an error message. Kinda counter productive...

  • SQL query - syntax help

    Hi All,
    I have a table that has 2 columns X, and Y.
    create table temp(
    x number(5);
    y number (5);
    );I am trying to write a query to check both columns, here is what I mean.
    SELECT CASE
                 IF X = 1 AND Y = 0 THEN 3
              IF X = 2 AND Y = 1 THEN 4
              IF X  = 4 AND Y IS NULL THEN 5
          END AS STATUS
    FROM .....temp ...etc.I know what I want but having problems with the syntax.
    Thanks in Advance for your help.
    I'm using Oracle 11g, SQL Dev 3.0

    select case when x = 1 and y = 0 then 3
                when x = 2 and y = 1 then 4
                when x = 4 and y is null then 5
                else null
            end ans
      from ...for more on the case syntax see either one of these links.
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/case_statement.htm
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/expressions004.htm

  • 11g SQL query syntax/results differ from 10g

    Hello,
    A bit of an odd situation.  We have a report in 10g that is working as expected and when we run the same report in 11g we slightly different results.  The same physical tables and columns are being used between each report and the number of records (17) returned to OBI are the same.  Both queries are pulling from the same database with the same user id.  As there are differences in how 10g runs queries vs 11g, are there any odd behaviors that I should keep an eye out for in how 11g assembles the data that's returned from the db prior to presenting it on the Analysis?  
    10g Results (correct):
    Region...............Actuals (Prior Qtr).....Up...........Plan Amount....................% of Plan
    AP...........................10,489..............8,965..............................................................
    Americas................114,208...........110,779..................6...........................1969411% 
    EMEA.....................26,799..............23,976..............................................................
    UNASSIGNED....................................................149,957...........................0%
    Grand Total.............151,496...........143,721..........149,962.........................96%
    11g Results (incorrect):
    Region...............Actuals (Prior Qtr).....Up...........Plan Amount....................% of Plan
    AP...........................10,180..............8,965............................................................
    Americas.................90,878...........110,779............................................................ 
    EMEA.....................24,978.............23,976............................................................
    UNASSIGNED....................................................149,957...........................0%
    Grand Total.............126,037..........143,721..........149,957.........................96%
    Thank you!
    Mike
    -------------------- 10g query--------------------------
    -------------------- Sending query to database named EBS Rapid Data Store (id: <<5087545>>):
    WITH
    SAWITH0 AS (select T28761.PERIOD_NAME as c2,
         T28761.PERIOD_START_DATE as c3,
         T28761.QUARTER_RANK as c4,
         ROW_NUMBER() OVER (PARTITION BY T28761.QUARTER_RANK ORDER BY T28761.QUARTER_RANK DESC) as c5
    from
         XXFI.XXFI_GL_FISCAL_MONTHS_V T28761 /* Dim_Periods */ ),
    SAWITH1 AS (select Case when case SAWITH0.c5 when 1 then SAWITH0.c3 else NULL end  is not null then Rank() OVER ( ORDER BY case SAWITH0.c5 when 1 then SAWITH0.c3 else NULL end  ASC NULLS LAST ) end as c1,
         SAWITH0.c2 as c2,
         SAWITH0.c4 as c3
    from
         SAWITH0),
    SAWITH2 AS (select min(SAWITH1.c1) over (partition by SAWITH1.c3)  as c1,
         SAWITH1.c2 as c2
    from
         SAWITH1),
    SAWITH3 AS (select distinct SAWITH2.c1 + 1 as c1,
         SAWITH2.c2 as c2
    from
         SAWITH2),
    SAWITH4 AS (select T28761.QUARTER_RANK as c2,
         T28761.QUARTER_YEAR_NAME as c3,
         T28761.PERIOD_START_DATE as c4,
         ROW_NUMBER() OVER (PARTITION BY T28761.QUARTER_RANK ORDER BY T28761.QUARTER_RANK DESC) as c5
    from
         XXFI.XXFI_GL_FISCAL_MONTHS_V T28761 /* Dim_Periods */ ),
    SAWITH5 AS (select Case when case SAWITH4.c5 when 1 then SAWITH4.c4 else NULL end  is not null then Rank() OVER ( ORDER BY case SAWITH4.c5 when 1 then SAWITH4.c4 else NULL end  ASC NULLS LAST ) end as c1,
         SAWITH4.c2 as c2,
         SAWITH4.c3 as c3
    from
         SAWITH4),
    SAWITH6 AS (select distinct min(SAWITH5.c1) over (partition by SAWITH5.c2)  as c1,
         SAWITH5.c2 as c2,
         SAWITH5.c3 as c3
    from
         SAWITH5),
    SAWITH7 AS (select D1.c1 as c1,
         D1.c2 as c2,
         D1.c3 as c3,
         D1.c4 as c4,
         D1.c5 as c5,
         D1.c6 as c6
    from
         (select sum(case  when T37838.POL_VERSION_FLAG = 'C' and T37838.FORECAST_PROBABILITY_PERCENT >= 75 then nvl(T37838.AMOUNT , 0) when T37838.PERIOD_NAME <> 'March-13' and T37838.FORECAST_PROBABILITY_PERCENT >= 75 and T37838.POL_VERSION_FLAG is null then nvl(T37838.AMOUNT , 0) else 0 end ) as c1,
                   SAWITH6.c3 as c2,
                   T41894.ICN_GROUP as c3,
                   SAWITH6.c2 as c4,
                   T41894.ICN_GROUP_CODE as c5,
                   T30728.PARENT_REGION as c6,
                   ROW_NUMBER() OVER (PARTITION BY T30728.PARENT_REGION, T41894.ICN_GROUP_CODE, SAWITH6.c2 ORDER BY T30728.PARENT_REGION ASC, T41894.ICN_GROUP_CODE ASC, SAWITH6.c2 ASC) as c7
              from
                   SAWITH3 left outer join (
                                  XXFI.XXFI_REVFCST_POL_REPORTING_V T37838 /* Fact_POL_Snapshot */  left outer join
                                  XXFI.XXFI_GEO_REGION_ACCUM T30728 /* Dim_Regions */  On T30728.COUNTRY_CODE = T37838.SHIP_TO_COUNTRY_CODE2) left outer join
                             XXFI.XXFI_ICN_OWNERS_V T41894 /* Dim_ICN_Override */  On T37838.OVERRIDE_ICN = T41894.ICN_CODE) On SAWITH3.c2 = T37838.PERIOD_NAME,
                   SAWITH6
              where  ( SAWITH6.c1 = SAWITH3.c1 and SAWITH6.c3 = '2010-Q2' and (T37838.PROSPECT_NUMBER is null or T37838.PROSPECT_NUMBER not like '%Budget%') )
              group by T30728.PARENT_REGION, T41894.ICN_GROUP_CODE, T41894.ICN_GROUP, SAWITH6.c2, SAWITH6.c3
         ) D1
    where  ( D1.c7 = 1 ) ),
    SAWITH8 AS (select sum(case  when T37838.POL_VERSION_FLAG = 'C' and T37838.FORECAST_PROBABILITY_PERCENT >= 75 then nvl(T37838.AMOUNT , 0) when T37838.PERIOD_NAME <> 'March-13' and T37838.FORECAST_PROBABILITY_PERCENT >= 75 and T37838.POL_VERSION_FLAG is null then nvl(T37838.AMOUNT , 0) else 0 end ) as c1,
         sum(case  when T37838.POL_VERSION_FLAG = 'C' and T37838.FORECAST_PROBABILITY_PERCENT >= 50 then nvl(T37838.AMOUNT , 0) when T37838.PERIOD_NAME <> 'March-13' and T37838.FORECAST_PROBABILITY_PERCENT >= 50 and T37838.POL_VERSION_FLAG is null then nvl(T37838.AMOUNT , 0) else 0 end ) as c2,
         T30728.PARENT_REGION as c3,
         T28761.QUARTER_YEAR_NAME as c6,
         T41894.ICN_GROUP as c7,
         T28761.QUARTER_RANK as c8,
         T41894.ICN_GROUP_CODE as c9
    from
                        XXFI.XXFI_REVFCST_POL_REPORTING_V T37838 /* Fact_POL_Snapshot */  left outer join
                        XXFI.XXFI_GL_FISCAL_MONTHS_V T28761 /* Dim_Periods */  On T28761.PERIOD_NAME = T37838.PERIOD_NAME) left outer join
                   XXFI.XXFI_GEO_REGION_ACCUM T30728 /* Dim_Regions */  On T30728.COUNTRY_CODE = T37838.SHIP_TO_COUNTRY_CODE2) left outer join
              XXFI.XXFI_ICN_OWNERS_V T41894 /* Dim_ICN_Override */  On T37838.OVERRIDE_ICN = T41894.ICN_CODE
    where  ( T28761.QUARTER_YEAR_NAME = '2010-Q2' and (T37838.PROSPECT_NUMBER is null or T37838.PROSPECT_NUMBER not like '%Budget%') )
    group by T28761.QUARTER_YEAR_NAME, T28761.QUARTER_RANK, T30728.PARENT_REGION, T41894.ICN_GROUP_CODE, T41894.ICN_GROUP),
    SAWITH9 AS (select D1.c1 as c1,
         D1.c2 as c2,
         D1.c3 as c3,
         D1.c4 as c4,
         D1.c5 as c5,
         D1.c6 as c6,
         D1.c7 as c7,
         D1.c8 as c8,
         D1.c9 as c9
    from
         (select sum(SAWITH8.c1) over (partition by SAWITH8.c3)  as c1,
                   sum(SAWITH8.c2) over (partition by SAWITH8.c3)  as c2,
                   SAWITH8.c3 as c3,
                   sum(SAWITH8.c1) over (partition by SAWITH8.c8, SAWITH8.c9, SAWITH8.c3)  as c4,
                   sum(SAWITH8.c2) over (partition by SAWITH8.c8, SAWITH8.c9, SAWITH8.c3)  as c5,
                   SAWITH8.c6 as c6,
                   SAWITH8.c7 as c7,
                   SAWITH8.c8 as c8,
                   SAWITH8.c9 as c9,
                   ROW_NUMBER() OVER (PARTITION BY SAWITH8.c3, SAWITH8.c8, SAWITH8.c9 ORDER BY SAWITH8.c3 ASC, SAWITH8.c8 ASC, SAWITH8.c9 ASC) as c10
              from
                   SAWITH8
         ) D1
    where  ( D1.c10 = 1 ) ),
    SAWITH10 AS (select sum(T34877.AMOUNT) as c1,
         T28761.QUARTER_YEAR_NAME as c3,
         T30728.PARENT_REGION as c4,
         T41894.ICN_GROUP as c5,
         T28761.QUARTER_RANK as c6,
         T41894.ICN_GROUP_CODE as c7
    from
                        XXFI.XXFI_REVENUE_BUDGET_ACCUM T34877 /* Fact_Revenue_Budgets */  left outer join
                        XXFI.XXFI_GL_FISCAL_MONTHS_V T28761 /* Dim_Periods */  On T28761.PERIOD_NAME = T34877.PERIOD_NAME) left outer join
                   XXFI.XXFI_GEO_REGION_ACCUM T30728 /* Dim_Regions */  On T30728.COUNTRY_CODE = T34877.SHIP_TO_COUNTRY_CODE2) left outer join
              XXFI.XXFI_ICN_OWNERS_V T41894 /* Dim_ICN_Override */  On T34877.OVERRIDE_ICN = T41894.ICN_CODE
    where  ( T28761.QUARTER_YEAR_NAME = '2010-Q2' )
    group by T28761.QUARTER_YEAR_NAME, T28761.QUARTER_RANK, T30728.PARENT_REGION, T41894.ICN_GROUP_CODE, T41894.ICN_GROUP),
    SAWITH11 AS (select D1.c1 as c1,
         D1.c2 as c2,
         D1.c3 as c3,
         D1.c4 as c4,
         D1.c5 as c5,
         D1.c6 as c6,
         D1.c7 as c7
    from
         (select sum(SAWITH10.c1) over (partition by SAWITH10.c4)  as c1,
                   sum(SAWITH10.c1) over (partition by SAWITH10.c6, SAWITH10.c7, SAWITH10.c4)  as c2,
                   SAWITH10.c3 as c3,
                   SAWITH10.c4 as c4,
                   SAWITH10.c5 as c5,
                   SAWITH10.c6 as c6,
                   SAWITH10.c7 as c7,
                   ROW_NUMBER() OVER (PARTITION BY SAWITH10.c4, SAWITH10.c6, SAWITH10.c7 ORDER BY SAWITH10.c4 ASC, SAWITH10.c6 ASC, SAWITH10.c7 ASC) as c8
              from
                   SAWITH10
         ) D1
    where  ( D1.c8 = 1 ) ),
    SAWITH12 AS (select T28761.PERIOD_NAME as c2,
         T28761.PERIOD_START_DATE as c3,
         T28761.QUARTER_RANK as c4,
         ROW_NUMBER() OVER (PARTITION BY T28761.QUARTER_RANK ORDER BY T28761.QUARTER_RANK DESC) as c5
    from
         XXFI.XXFI_GL_FISCAL_MONTHS_V T28761 /* Dim_Periods */ ),
    SAWITH13 AS (select Case when case SAWITH12.c5 when 1 then SAWITH12.c3 else NULL end  is not null then Rank() OVER ( ORDER BY case SAWITH12.c5 when 1 then SAWITH12.c3 else NULL end  ASC NULLS LAST ) end as c1,
         SAWITH12.c2 as c2,
         SAWITH12.c4 as c3
    from
         SAWITH12),
    SAWITH14 AS (select min(SAWITH13.c1) over (partition by SAWITH13.c3)  as c1,
         SAWITH13.c2 as c2
    from
         SAWITH13),
    SAWITH15 AS (select distinct SAWITH14.c1 + 1 as c1,
         SAWITH14.c2 as c2
    from
         SAWITH14),
    SAWITH16 AS (select T28761.QUARTER_YEAR_NAME as c2,
         T28761.PERIOD_START_DATE as c3,
         T28761.QUARTER_RANK as c4,
         ROW_NUMBER() OVER (PARTITION BY T28761.QUARTER_RANK ORDER BY T28761.QUARTER_RANK DESC) as c5
    from
         XXFI.XXFI_GL_FISCAL_MONTHS_V T28761 /* Dim_Periods */ ),
    SAWITH17 AS (select Case when case SAWITH16.c5 when 1 then SAWITH16.c3 else NULL end  is not null then Rank() OVER ( ORDER BY case SAWITH16.c5 when 1 then SAWITH16.c3 else NULL end  ASC NULLS LAST ) end as c1,
         SAWITH16.c2 as c2,
         SAWITH16.c4 as c3
    from
         SAWITH16),
    SAWITH18 AS (select distinct min(SAWITH17.c1) over (partition by SAWITH17.c3)  as c1,
         SAWITH17.c2 as c2
    from
         SAWITH17),
    SAWITH19 AS (select sum(case  when T37838.POL_VERSION_FLAG = 'C' and T37838.FORECAST_PROBABILITY_PERCENT >= 75 then nvl(T37838.AMOUNT , 0) when T37838.PERIOD_NAME <> 'March-13' and T37838.FORECAST_PROBABILITY_PERCENT >= 75 and T37838.POL_VERSION_FLAG is null then nvl(T37838.AMOUNT , 0) else 0 end ) as c1,
         T30728.PARENT_REGION as c2
    from
         SAWITH15 left outer join (
                   XXFI.XXFI_REVFCST_POL_REPORTING_V T37838 /* Fact_POL_Snapshot */  left outer join
                   XXFI.XXFI_GEO_REGION_ACCUM T30728 /* Dim_Regions */  On T30728.COUNTRY_CODE = T37838.SHIP_TO_COUNTRY_CODE2) On SAWITH15.c2 = T37838.PERIOD_NAME,
         SAWITH18
    where  ( SAWITH18.c1 = SAWITH15.c1 and SAWITH18.c2 = '2010-Q2' and (T37838.PROSPECT_NUMBER is null or T37838.PROSPECT_NUMBER not like '%Budget%') )
    group by T30728.PARENT_REGION),
    SAWITH20 AS (select T28761.PERIOD_NAME as c2,
         T28761.PERIOD_START_DATE as c3,
         T28761.QUARTER_RANK as c4,
         ROW_NUMBER() OVER (PARTITION BY T28761.QUARTER_RANK ORDER BY T28761.QUARTER_RANK DESC) as c5
    from
         XXFI.XXFI_GL_FISCAL_MONTHS_V T28761 /* Dim_Periods */ ),
    SAWITH21 AS (select Case when case SAWITH20.c5 when 1 then SAWITH20.c3 else NULL end  is not null then Rank() OVER ( ORDER BY case SAWITH20.c5 when 1 then SAWITH20.c3 else NULL end  ASC NULLS LAST ) end as c1,
         SAWITH20.c2 as c2,
         SAWITH20.c4 as c3
    from
         SAWITH20),
    SAWITH22 AS (select min(SAWITH21.c1) over (partition by SAWITH21.c3)  as c1,
         SAWITH21.c2 as c2
    from
         SAWITH21),
    SAWITH23 AS (select distinct SAWITH22.c1 + 1 as c1,
         SAWITH22.c2 as c2
    from
         SAWITH22),
    SAWITH24 AS (select T28761.QUARTER_YEAR_NAME as c2,
         T28761.PERIOD_START_DATE as c3,
         T28761.QUARTER_RANK as c4,
         ROW_NUMBER() OVER (PARTITION BY T28761.QUARTER_RANK ORDER BY T28761.QUARTER_RANK DESC) as c5
    from
         XXFI.XXFI_GL_FISCAL_MONTHS_V T28761 /* Dim_Periods */ ),
    SAWITH25 AS (select Case when case SAWITH24.c5 when 1 then SAWITH24.c3 else NULL end  is not null then Rank() OVER ( ORDER BY case SAWITH24.c5 when 1 then SAWITH24.c3 else NULL end  ASC NULLS LAST ) end as c1,
         SAWITH24.c2 as c2,
         SAWITH24.c4 as c3
    from
         SAWITH24),
    SAWITH26 AS (select distinct min(SAWITH25.c1) over (partition by SAWITH25.c3)  as c1,
         SAWITH25.c2 as c2
    from
         SAWITH25),
    SAWITH27 AS (select sum(case  when T37838.POL_VERSION_FLAG = 'C' and T37838.FORECAST_PROBABILITY_PERCENT >= 75 then nvl(T37838.AMOUNT , 0) when T37838.PERIOD_NAME <> 'March-13' and T37838.FORECAST_PROBABILITY_PERCENT >= 75 and T37838.POL_VERSION_FLAG is null then nvl(T37838.AMOUNT , 0) else 0 end ) as c1
    from
         SAWITH23 left outer join XXFI.XXFI_REVFCST_POL_REPORTING_V T37838 /* Fact_POL_Snapshot */  On SAWITH23.c2 = T37838.PERIOD_NAME,
         SAWITH26
    where  ( SAWITH26.c1 = SAWITH23.c1 and SAWITH26.c2 = '2010-Q2' and (T37838.PROSPECT_NUMBER is null or T37838.PROSPECT_NUMBER not like '%Budget%') ) ),
    SAWITH28 AS (select sum(case  when T37838.POL_VERSION_FLAG = 'C' and T37838.FORECAST_PROBABILITY_PERCENT >= 75 then nvl(T37838.AMOUNT , 0) when T37838.PERIOD_NAME <> 'March-13' and T37838.FORECAST_PROBABILITY_PERCENT >= 75 and T37838.POL_VERSION_FLAG is null then nvl(T37838.AMOUNT , 0) else 0 end ) as c1,
         sum(case  when T37838.POL_VERSION_FLAG = 'C' and T37838.FORECAST_PROBABILITY_PERCENT >= 50 then nvl(T37838.AMOUNT , 0) when T37838.PERIOD_NAME <> 'March-13' and T37838.FORECAST_PROBABILITY_PERCENT >= 50 and T37838.POL_VERSION_FLAG is null then nvl(T37838.AMOUNT , 0) else 0 end ) as c2
    from
              XXFI.XXFI_REVFCST_POL_REPORTING_V T37838 /* Fact_POL_Snapshot */  left outer join
              XXFI.XXFI_GL_FISCAL_MONTHS_V T28761 /* Dim_Periods */  On T28761.PERIOD_NAME = T37838.PERIOD_NAME
    where  ( T28761.QUARTER_YEAR_NAME = '2010-Q2' and (T37838.PROSPECT_NUMBER is null or T37838.PROSPECT_NUMBER not like '%Budget%') ) ),
    SAWITH29 AS (select sum(T34877.AMOUNT) as c1
    from
              XXFI.XXFI_REVENUE_BUDGET_ACCUM T34877 /* Fact_Revenue_Budgets */  left outer join
              XXFI.XXFI_GL_FISCAL_MONTHS_V T28761 /* Dim_Periods */  On T28761.PERIOD_NAME = T34877.PERIOD_NAME
    where  ( T28761.QUARTER_YEAR_NAME = '2010-Q2' ) )
    select case  when SAWITH7.c2 is not null then SAWITH7.c2 when SAWITH9.c6 is not null then SAWITH9.c6 when SAWITH11.c3 is not null then SAWITH11.c3 end  as c1,
         case  when SAWITH9.c3 is not null then SAWITH9.c3 when SAWITH19.c2 is not null then SAWITH19.c2 when SAWITH7.c6 is not null then SAWITH7.c6 when SAWITH11.c4 is not null then SAWITH11.c4 end  as c2,
         case  when SAWITH7.c3 is not null then SAWITH7.c3 when SAWITH9.c7 is not null then SAWITH9.c7 when SAWITH11.c5 is not null then SAWITH11.c5 end  as c3,
         SAWITH9.c5 / nullif( 1000, 0) as c4,
         SAWITH7.c1 / nullif( 1000, 0) as c5,
         SAWITH11.c2 / nullif( 1000, 0) as c6,
         nvl(SAWITH9.c4 , 0) / nullif( nvl(SAWITH11.c2 , 0), 0) * 100 as c7,
         case  when SAWITH7.c4 is not null then SAWITH7.c4 when SAWITH9.c8 is not null then SAWITH9.c8 when SAWITH11.c6 is not null then SAWITH11.c6 end  as c16,
         case  when SAWITH11.c7 is not null then SAWITH11.c7 when SAWITH9.c9 is not null then SAWITH9.c9 when SAWITH7.c5 is not null then SAWITH7.c5 end  as c17,
         SAWITH27.c1 as c19,
         SAWITH28.c2 as c20,
         SAWITH29.c1 as c21,
         SAWITH28.c1 as c22,
         SAWITH19.c1 as c23,
         SAWITH9.c2 as c24,
         SAWITH11.c1 as c25,
         SAWITH9.c1 as c26
    from
                   SAWITH7 full outer join SAWITH9 On SAWITH7.c5 = SAWITH9.c9 and nvl(SAWITH7.c4 , 88.0) = nvl(SAWITH9.c8 , 88.0) and nvl(SAWITH7.c4 , 99.0) = nvl(SAWITH9.c8 , 99.0) and nvl(SAWITH7.c6 , 'q') = nvl(SAWITH9.c3 , 'q') and nvl(SAWITH7.c6 , 'z') = nvl(SAWITH9.c3 , 'z')) full outer join SAWITH11 On SAWITH11.c7 = case  when SAWITH7.c5 is not null then SAWITH7.c5 when SAWITH9.c9 is not null then SAWITH9.c9 end  and nvl(SAWITH11.c4 , 'q') = nvl(case  when SAWITH7.c6 is not null then SAWITH7.c6 when SAWITH9.c3 is not null then SAWITH9.c3 end  , 'q') and nvl(SAWITH11.c4 , 'z') = nvl(case  when SAWITH7.c6 is not null then SAWITH7.c6 when SAWITH9.c3 is not null then SAWITH9.c3 end  , 'z') and nvl(SAWITH11.c6 , 88.0) = nvl(case  when SAWITH7.c4 is not null then SAWITH7.c4 when SAWITH9.c8 is not null then SAWITH9.c8 end  , 88.0) and nvl(SAWITH11.c6 , 99.0) = nvl(case  when SAWITH7.c4 is not null then SAWITH7.c4 when SAWITH9.c8 is not null then SAWITH9.c8 end  , 99.0)) full outer join SAWITH19 On nvl(SAWITH19.c2 , 'q') = nvl(case  when SAWITH7.c6 is not null then SAWITH7.c6 when SAWITH9.c3 is not null then SAWITH9.c3 when SAWITH11.c4 is not null then SAWITH11.c4 end  , 'q') and nvl(SAWITH19.c2 , 'z') = nvl(case  when SAWITH7.c6 is not null then SAWITH7.c6 when SAWITH9.c3 is not null then SAWITH9.c3 when SAWITH11.c4 is not null then SAWITH11.c4 end  , 'z'),
         SAWITH27,
         SAWITH28,
         SAWITH29
    order by c2
    +++:cfa20000:cfa20015:----2013/08/14 10:31:12
    -------------------- Query Status: Successful Completion
    +++:cfa20000:cfa20015:----2013/08/14 10:31:12
    -------------------- Rows 21, bytes 34272 retrieved from database query id: <<5087545>>
    +++:cfa20000:cfa20015:----2013/08/14 10:31:12
    -------------------- Physical query response time 27 (seconds), id <<5087545>>
    +++:cfa20000:cfa20015:----2013/08/14 10:31:12
    -------------------- Physical Query Summary Stats: Number of physical queries 1, Cumulative time 27, DB-connect time 0 (seconds)
    +++:cfa20000:cfa20015:----2013/08/14 10:31:12
    -------------------- Rows returned to Client 17
    ---------------------------------------------  11g Query ----------------------------------------------------------
    Sending query to database named EBS Rapid Data Store (id: <<2779207>>), connection pool named EBS XXFI Connection Pool, logical request hash 1334563, physical request hash 292e1532: [[
    WITH
    OBICOMMON0 AS (select T28761.PERIOD_NAME as c2,
         T28761.PERIOD_START_DATE as c3,
         T28761.QUARTER_RANK as c4,
         ROW_NUMBER() OVER (PARTITION BY T28761.QUARTER_RANK ORDER BY T28761.QUARTER_RANK DESC) as c5,
         T28761.QUARTER_YEAR_NAME as c6
    from
         XXFI.XXFI_GL_FISCAL_MONTHS_V T28761 /* Dim_Periods */ ),
    SAWITH0 AS (select Case when case D1.c5 when 1 then D1.c3 else NULL end  is not null then Rank() OVER ( ORDER BY case D1.c5 when 1 then D1.c3 else NULL end  ASC NULLS LAST ) end as c1,
         D1.c2 as c2,
         D1.c4 as c3
    from
         OBICOMMON0 D1),
    SAWITH1 AS (select min(D1.c1) over (partition by D1.c3)  as c1,
         D1.c2 as c2
    from
         SAWITH0 D1),
    SAWITH2 AS (select distinct D1.c1 + 1 as c1,
         D1.c2 as c2
    from
         SAWITH1 D1),
    SAWITH3 AS (select Case when case D1.c5 when 1 then D1.c3 else NULL end  is not null then Rank() OVER ( ORDER BY case D1.c5 when 1 then D1.c3 else NULL end  ASC NULLS LAST ) end as c1,
         D1.c6 as c2,
         D1.c4 as c3
    from
         OBICOMMON0 D1),
    SAWITH4 AS (select distinct min(D1.c1) over (partition by D1.c3)  as c1,
         D1.c2 as c2,
         D1.c3 as c3
    from
         SAWITH3 D1),
    SAWITH5 AS (select sum(case  when T37838.POL_VERSION_FLAG = 'C' and T37838.FORECAST_PROBABILITY_PERCENT >= 75 then nvl(T37838.AMOUNT , 0) when T37838.PERIOD_NAME <> 'March-13' and T37838.FORECAST_PROBABILITY_PERCENT >= 75 and T37838.POL_VERSION_FLAG is null then nvl(T37838.AMOUNT , 0) else 0 end ) as c1,
         D4.c2 as c2,
         T41894.ICN_GROUP as c3,
         T30728.PARENT_REGION as c4,
         D4.c3 as c5,
         T41894.ICN_GROUP_CODE as c6
    from
         SAWITH2 D6 left outer join (
                        XXFI.XXFI_REVFCST_POL_REPORTING_V T37838 /* Fact_POL_Snapshot */  left outer join
                        XXFI.XXFI_GEO_REGION_ACCUM T30728 /* Dim_Regions */  On T30728.COUNTRY_CODE = T37838.SHIP_TO_COUNTRY_CODE2) left outer join
                   XXFI.XXFI_ICN_OWNERS_V T41894 /* Dim_ICN_Override */  On T37838.OVERRIDE_ICN = T41894.ICN_CODE) On D6.c2 = T37838.PERIOD_NAME,
         SAWITH4 D4
    where  ( D4.c1 = D6.c1 and D4.c2 = '2010-Q2' and (T37838.PROSPECT_NUMBER is null or T37838.PROSPECT_NUMBER not like '%Budget%') )
    group by T30728.PARENT_REGION, T41894.ICN_GROUP_CODE, T41894.ICN_GROUP, D4.c2, D4.c3),
    SAWITH6 AS (select sum(case  when T37838.POL_VERSION_FLAG = 'C' and T37838.FORECAST_PROBABILITY_PERCENT >= 50 then nvl(T37838.AMOUNT , 0) when T37838.PERIOD_NAME <> 'March-13' and T37838.FORECAST_PROBABILITY_PERCENT >= 50 and T37838.POL_VERSION_FLAG is null then nvl(T37838.AMOUNT , 0) else 0 end ) as c1,
         sum(case  when T37838.POL_VERSION_FLAG = 'C' and T37838.FORECAST_PROBABILITY_PERCENT >= 75 then nvl(T37838.AMOUNT , 0) when T37838.PERIOD_NAME <> 'March-13' and T37838.FORECAST_PROBABILITY_PERCENT >= 75 and T37838.POL_VERSION_FLAG is null then nvl(T37838.AMOUNT , 0) else 0 end ) as c2,
         T28761.QUARTER_YEAR_NAME as c3,
         T41894.ICN_GROUP as c4,
         T30728.PARENT_REGION as c5,
         T28761.QUARTER_RANK as c6,
         T41894.ICN_GROUP_CODE as c7
    from
                        XXFI.XXFI_REVFCST_POL_REPORTING_V T37838 /* Fact_POL_Snapshot */  left outer join
                        XXFI.XXFI_GL_FISCAL_MONTHS_V T28761 /* Dim_Periods */  On T28761.PERIOD_NAME = T37838.PERIOD_NAME) left outer join
                   XXFI.XXFI_GEO_REGION_ACCUM T30728 /* Dim_Regions */  On T30728.COUNTRY_CODE = T37838.SHIP_TO_COUNTRY_CODE2) left outer join
              XXFI.XXFI_ICN_OWNERS_V T41894 /* Dim_ICN_Override */  On T37838.OVERRIDE_ICN = T41894.ICN_CODE
    where  ( T28761.QUARTER_YEAR_NAME = '2010-Q2' and (T37838.PROSPECT_NUMBER is null or T37838.PROSPECT_NUMBER not like '%Budget%') )
    group by T28761.QUARTER_YEAR_NAME, T28761.QUARTER_RANK, T30728.PARENT_REGION, T41894.ICN_GROUP_CODE, T41894.ICN_GROUP),
    SAWITH7 AS (select sum(T34877.AMOUNT) as c1,
         T28761.QUARTER_YEAR_NAME as c2,
         T41894.ICN_GROUP as c3,
         T30728.PARENT_REGION as c4,
         T28761.QUARTER_RANK as c5,
         T41894.ICN_GROUP_CODE as c6
    from
                        XXFI.XXFI_REVENUE_BUDGET_ACCUM T34877 /* Fact_Revenue_Budgets */  left outer join
                        XXFI.XXFI_GL_FISCAL_MONTHS_V T28761 /* Dim_Periods */  On T28761.PERIOD_NAME = T34877.PERIOD_NAME) left outer join
                   XXFI.XXFI_GEO_REGION_ACCUM T30728 /* Dim_Regions */  On T30728.COUNTRY_CODE = T34877.SHIP_TO_COUNTRY_CODE2) left outer join
              XXFI.XXFI_ICN_OWNERS_V T41894 /* Dim_ICN_Override */  On T34877.OVERRIDE_ICN = T41894.ICN_CODE
    where  ( T28761.QUARTER_YEAR_NAME = '2010-Q2' )
    group by T28761.QUARTER_YEAR_NAME, T28761.QUARTER_RANK, T30728.PARENT_REGION, T41894.ICN_GROUP_CODE, T41894.ICN_GROUP),
    SAWITH8 AS (select D1.c1 as c1,
         D1.c2 as c2,
         D1.c3 as c3,
         D1.c4 as c4,
         D1.c5 as c5,
         D1.c6 as c6,
         D1.c7 as c7,
         D1.c8 as c8,
         D1.c9 as c9,
         D1.c18 as c18,
         D1.c19 as c19,
         D1.c20 as c20,
         D1.c21 as c21,
         D1.c22 as c22
    from
         (select 0 as c1,
                   case  when D1.c2 is not null then D1.c2 when D2.c3 is not null then D2.c3 when D3.c2 is not null then D3.c2 end  as c2,
                   case  when D1.c3 is not null then D1.c3 when D2.c4 is not null then D2.c4 when D3.c3 is not null then D3.c3 end  as c3,
                   case  when D1.c4 is not null then D1.c4 when D2.c5 is not null then D2.c5 when D3.c4 is not null then D3.c4 end  as c4,
                   case  when D1.c5 is not null then D1.c5 when D2.c6 is not null then D2.c6 when D3.c5 is not null then D3.c5 end  as c5,
                   nvl(D2.c2 , 0) / nullif( nvl(D3.c1 , 0), 0) * 100 as c6,
                   D3.c1 / 1000 as c7,
                   D1.c1 / 1000 as c8,
                   D2.c1 / 1000 as c9,
                   case  when D1.c6 is not null then D1.c6 when D2.c7 is not null then D2.c7 when D3.c6 is not null then D3.c6 end  as c18,
                   D2.c2 as c19,
                   D3.c1 as c20,
                   D1.c1 as c21,
                   D2.c1 as c22,
                   ROW_NUMBER() OVER (PARTITION BY case  when D1.c2 is not null then D1.c2 when D2.c3 is not null then D2.c3 when D3.c2 is not null then D3.c2 end , case  when D1.c3 is not null then D1.c3 when D2.c4 is not null then D2.c4 when D3.c3 is not null then D3.c3 end , case  when D1.c4 is not null then D1.c4 when D2.c5 is not null then D2.c5 when D3.c4 is not null then D3.c4 end , case  when D1.c5 is not null then D1.c5 when D2.c6 is not null then D2.c6 when D3.c5 is not null then D3.c5 end , case  when D1.c6 is not null then D1.c6 when D2.c7 is not null then D2.c7 when D3.c6 is not null then D3.c6 end  ORDER BY case  when D1.c2 is not null then D1.c2 when D2.c3 is not null then D2.c3 when D3.c2 is not null then D3.c2 end  ASC, case  when D1.c3 is not null then D1.c3 when D2.c4 is not null then D2.c4 when D3.c3 is not null then D3.c3 end  ASC, case  when D1.c4 is not null then D1.c4 when D2.c5 is not null then D2.c5 when D3.c4 is not null then D3.c4 end  ASC, case  when D1.c5 is not null then D1.c5 when D2.c6 is not null then D2.c6 when D3.c5 is not null then D3.c5 end  ASC, case  when D1.c6 is not null then D1.c6 when D2.c7 is not null then D2.c7 when D3.c6 is not null then D3.c6 end  ASC) as c23
              from
                        SAWITH5 D1 full outer join SAWITH6 D2 On D1.c6 = D2.c7 and  SYS_OP_MAP_NONNULL(D1.c4) = SYS_OP_MAP_NONNULL(D2.c5)  and  SYS_OP_MAP_NONNULL(D1.c5) = SYS_OP_MAP_NONNULL(D2.c6) ) full outer join SAWITH7 D3 On D3.c6 = case  when D1.c6 is not null then D1.c6 when D2.c7 is not null then D2.c7 end  and  SYS_OP_MAP_NONNULL(D3.c4) = SYS_OP_MAP_NONNULL(case  when D1.c4 is not null then D1.c4 when D2.c5 is not null then D2.c5 end )  and  SYS_OP_MAP_NONNULL(D3.c5) = SYS_OP_MAP_NONNULL(case  when D1.c5 is not null then D1.c5 when D2.c6 is not null then D2.c6 end )
         ) D1
    where  ( D1.c23 = 1 ) )
    select D1.c1 as c1,
         D1.c2 as c2,
         D1.c3 as c3,
         D1.c4 as c4,
         D1.c5 as c5,
         D1.c6 as c6,
         D1.c7 as c7,
         D1.c8 as c8,
         D1.c9 as c9,
         D1.c18 as c19,
         D1.c19 as c21,
         D1.c20 as c22,
         D1.c21 as c23,
         D1.c22 as c24
    from
         SAWITH8 D1
    order by c4, c2, c5, c19, c3
    [2013-08-14T10:38:15.000-05:00] [OracleBIServerComponent] [TRACE:2] [USER-34] [] [ecid: 54a0696aeaefab88:-d74da91:1406506ef2a:-8000-00000000000151e6,0:1:9:6:1] [tid: a093e700] [requestid: cc480014] [sessionid: cc480000] [username: ] -------------------- Query Status: Successful Completion [[
    [2013-08-14T10:38:15.000-05:00] [OracleBIServerComponent] [TRACE:2] [USER-26] [] [ecid: 54a0696aeaefab88:-d74da91:1406506ef2a:-8000-00000000000151e6,0:1:9:6:1] [tid: a093e700] [requestid: cc480014] [sessionid: cc480000] [username: ] -------------------- Rows 17, bytes 27200 retrieved from database query id: <<2779207>>

    check the report for the columns which has incorrect values for any calculation, null handling.
    also check whether there is a difference in logical SQL between 10g and 11g.
    also check whether they are pointing to same db.
    check for null handling or default value not being set in 11g.
    try rebuilding the same report, to check the metrics individually verify they match with 10g.

Maybe you are looking for

  • Display problem in my hp pavilion -15e015tx the screen blinks and get freeze for a second

    i am using hp pavilion 15-e015tx running window 8 i had complained on 18 oct 2014 regarding the display problem. my case id is 4739018980. till now the issuse is not solved. the engineer came , checked the laptop and said quotation will be send withi

  • How to stop a pop up - Goodgame Empire

    While browsing the net, from email to facebook to youtube to forums, I get the same annoying pop up - Goodgame Empire -(http://lp.empire.goodgamestudios.com/?country=us&pid=248&camp=1&gid=12&cid=785514&tid=18668003%A0). A new tab will randomly open e

  • Er msg Apple Mobile Device failed to start

    I unstalled iCloud 3.1 then started getting start-up error, Itunes.exe; "The program can't start because MSVCR80.dll is missing from your computer. Reinstall itunes. " When I reinstall I get another error msg, Service Apple Mobil Service failed to st

  • Missing Print Settings

    Unable to bring up Print Settings, Printer Color Management , or Copies settings on Mac with Leopard OS X 10.5.6 . I have an Epson Stylus Pro 3800 and am using Photoshop CS3 Extended. Think everything is updated for all programs, so not sure what I a

  • Where is Taligent's 'Porting C++ to Java'?

    I have spent several hours searching the Web for 'Porting C++ Java' and similar as search key. I have found and downloaded three: 1. Moving C and C++ code to Java (in Java Tricks of the Programming Gurus) by Glenn L. Vanderburg. et al. 2. Porting a C