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.

Similar Messages

  • Sql query to get numbers from 0 to 99

    How can we write an sql query to get values from 0 to 99 ... this shouldn't be coming from any table

    Bawer wrote:
    Result: (quickly replied by oracle)
    SQL-Error: ORA-30009 (Not enough memory for connect by - 1GB reserved for oracle on VirtualBox)Oracle version? Takes about 8 seconds on my:
    SQL> select * from v$version
      2  /
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod
    PL/SQL Release 10.2.0.4.0 - Production
    CORE    10.2.0.4.0      Production
    TNS for 32-bit Windows: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    Elapsed: 00:00:00.14
    SQL> select count(*) from (
      2  SELECT LEVEL - 1
      3  FROM DUAL
      4  CONNECT BY LEVEL <= 10000000
      5  )
      6  /
      COUNT(*)
      10000000
    Elapsed: 00:00:07.76
    SQL> SY.

  • SQL query to fetch records  from  26 onwards

    Want to know SQL query to fetch records from 26 onwards.

    See the fifth entry on the FAQ page:
    Re: How to attach a java bean in forms6i

  • How will write SQL query to fetch data from  each Sub-partition..

    Hi All,
    Anyone does have any idea about How to write SQL query to fetch data from Sub-partition.
    Actually i have one table having composite paritition(Range+list)
    Now if i want to fetch data from main partition(Range) the query will be
    SELECT * FROM emp PARTITION(q1_2005);
    Now i want to fetch data at sub-partition level(List) .But i am not able to get any SQL query for that.
    Pls help me to sort out.
    Thanks in Advance.
    Anwar

    SELECT * FROM emp SUBPARTITION(sp1);

  • 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

  • Executing sql query(not through sqlfile) from batchfile

    Hi,
    I have written a batchfile below which should execute the sql query. Can someone please help me in modifying the below code. I know we can make use of sql file ,but wanted it to be more robust and hence everything in a single batch file instead of having combination of sqlfile and batchfile.
    @echo off
    set ORACLE_HOME=%RAMBOH%
    set ORACLE_SID=%RAMBSID%
    set path=%RAMBOH%\bin;%RAMBOH%\admin\Ramb_Scripts;%path%
    sqlplus sys/XXX as sysdba
    @echo SET SERVEROUTPUT ON;
    @echo DECLARE
    @echo     v1   DATE;
    @echo BEGIN
    @echo     SELECT SYSDATE INTO V1 FROM DUAL;
    @echo     DBMS_OUTPUT.PUT_LINE(v1);
    @echo END;
    @echo /

    I used the below syntax to execute a procedure
    set ORACLE_SID=orcl
    echo exec MyProcedure;
    echo exit
    )|sqlplus system/manager >MyProcedure.log
    Try making modifications to this and see if this helps you in executing the SQL from the batch file

  • Discoverer Report showing Null VS Show SQL query showing results !!!

    I created a simple Cross Tab Discoverer report from a custom SQL which has a calculation for balances. The output is giving all null values even though there are balances. The output doesn't seem right. So I copied the query from Tools-->Show SQL and ran the query in the TOAD where I'm showing balances for the report. I don't understand why it is not showing in the discoverer. Please help.
    Thanks
    Edited by: PA1B on Jan 27, 2010 11:40 AM

    Sorry for late reply.
    Below is the Show SQL query. I don't think the query is application dependent. C_1 is my calculation.
    SELECT o279709.SEGMENT3 as E279727,
    o279709.SEGMENT4 as E279728,
    CASE WHEN o279709.CURRENCY_CODE = 'USD' AND o279709.TRANSLATED_FLAG <> 'Y' THEN SUM(o279709.ENDING_BAL) ELSE 0 END as C_1,
    GROUPING_ID(o279709.CURRENCY_CODE,o279709.SEGMENT3,o279709.SEGMENT4,o279709.TRANSLATED_FLAG) as GID
    FROM ( --Foriegn Entity USD Balances
    SELECT                B.SEGMENT1,
                                       B.SEGMENT2,     
                                       B.SEGMENT3,
                                  (select distinct substr(cat.COMPILED_VALUE_ATTRIBUTES,5,1) from apps.fnd_flex_values cat
                   where FLEX_VALUE_SET_ID = (select bat.FLEX_VALUE_SET_ID from apps.fnd_id_flex_structures_vl aat, apps.fnd_id_flex_segments_vl bat
                                                                                                                       where bat.id_flex_code = 'GL#' and
                                                                                                                            bat.id_flex_code = aat.id_flex_code and
                                                                                                                            aat.APPLICATION_ID = bat.APPLICATION_ID and
                                                                                                                            aat.APPLICATION_ID = 101 and
                                                                                                                            bat.SEGMENT_NAME = 'Prime Account' and
                                                                                                                            aat.id_flex_num = bat.id_flex_num
                                                                                                                            and bat.id_flex_num in (select distinct chart_of_accounts_id from apps.gl_code_combinations gat
                                                                                                                                                                              where gat.code_combination_id = A.code_combination_id))
                                       and cat.flex_value = b.segment3) ACCT_TYPE ,
                                       B.SEGMENT4,
                                       B.SEGMENT5,
                                       B.SEGMENT6,
                                       B.SEGMENT7,
                                       B.SEGMENT8,
                                       B.SEGMENT9,
                                       B.SEGMENT10,
                                       B.SEGMENT11,
                                       B.SEGMENT12,
                                       B.SEGMENT13,
                                       C.NAME,
    A.SET_OF_BOOKS_ID,
                                       A.CURRENCY_CODE,A.TRANSLATED_FLAG,
                                  SUM(NVL(A.BEGIN_BALANCE_DR,0) - NVL(A.BEGIN_BALANCE_CR,0)) BEG_BAL,
                                  SUM(NVL(A.PERIOD_NET_DR,0)) DEBITS,
    SUM( NVL(A.PERIOD_NET_CR,0)) CREDITS ,
    A.PERIOD_NAME,
                                  SUM(NVL(A.BEGIN_BALANCE_DR,0) - NVL(A.BEGIN_BALANCE_CR,0))+ SUM(NVL(A.PERIOD_NET_DR,0) - NVL(A.PERIOD_NET_CR,0)) ENDING_BAL
    FROM                     APPS.GL_BALANCES A ,
                                       APPS.GL_CODE_COMBINATIONS B,
                                       APPS.GL_SETS_OF_BOOKS     C
    WHERE                     A.CODE_COMBINATION_ID = B.CODE_COMBINATION_ID
    --AND                           A.PERIOD_NAME = 'SEP-09'
    AND                          C.SET_OF_BOOKS_ID = A.SET_OF_BOOKS_ID
    --AND                           A.TRANSLATED_FLAG <> 'Y'
    --AND                           B.SEGMENT1 = '83101'
    --AND                           B.SEGMENT3 = '14602'
    --AND                           A.SET_OF_BOOKS_ID = 77
    --AND                           A.CURRENCY_CODE = 'USD'
    GROUP BY           A.CODE_COMBINATION_ID,
                                  B.SEGMENT1,
                                       B.SEGMENT2,     
                                       B.SEGMENT3,
                                       B.SEGMENT4,
                                       B.SEGMENT5,
                                       B.SEGMENT6,
                                       B.SEGMENT7,
                                       B.SEGMENT8,
                                       B.SEGMENT9,
                                       B.SEGMENT10,
                                       B.SEGMENT11,
                                       B.SEGMENT12,
                                       B.SEGMENT13,          
                                       A.CURRENCY_CODE,
                                       A.TRANSLATED_FLAG,
                                       C.NAME,A.PERIOD_NAME,
    A.SET_OF_BOOKS_ID
    ) o279709
    WHERE (o279709.PERIOD_NAME = 'DEC-09')
    AND (o279709.SET_OF_BOOKS_ID <> 72)
    AND (o279709.SEGMENT12 = '000')
    AND (o279709.SEGMENT3 IN ('10101','10301','10502','12001'))
    AND (o279709.SEGMENT1 IN ('82901','82902','82903','83001','83003','83201'))
    GROUP BY GROUPING SETS(( o279709.CURRENCY_CODE,o279709.SEGMENT3,o279709.SEGMENT4,o279709.TRANSLATED_FLAG ),( o279709.SEGMENT3,o279709.SEGMENT4 ),( o279709.SEGMENT3 ))
    HAVING (GROUP_ID()=0)
    ORDER BY GID DESC;
    Thanks,
    PA1
    Edited by: PA1B on Jan 29, 2010 12:50 PM

  • Help Required -- Can we use SQL Query to READ data from SAP MDM Tables

    Hi All,
    Please help.........
    Can we use SQL Query to READ(No Creation/Updation/Deletion  just Read) Data from SAP MDM tables directly, without using MDM Syndicator.
    Or direct SQL access to SAP MDM tables is not possible. Only through MDM Syndicator can we export data.
    Thanks in Advance
    Regards

    All the tables you create in Repository comes under A2i_CM_Tables in Database named as your repository name. So the tables names are fields of table A2i_CM_Tables. Now i tried it but cant make it.
    Now, I dont think its possible to extract all fields in tables and there values using select query. May be pure sql guy can do that or not.
    But there is no relation of data extraction and syndicator. Data is viewed in Data Manager. and you can also store data in a file from DM also.
    BR,
    Alok

  • 11g pivot query syntax question

    I searched the forums and I have seen questions similiar to the one I am asking, but its not the exact same issue.
    I need 3 fields in my 'for' clause. I get 'column ambiguously defined. I think I get this error for a different reason that other people asking the question.
    The others seem to be doing more than 1 function in the pivot clause and those need an alias. I give an alias with my 1 function and still get an error.
    ORA-00918: column ambiguously defined
    I used aliases like the recommendation in other posts and I still get the same error. I think I need 3 columns in the for clause.
    --note that this is just a test table. These are not real names going into production
    create table pivot_tab (
    pk1 number,
    pk2 number,
    myElement varchar2(30),
    myElementDate date);
    pk1,pk2 are the unique key.
    I need this to return as: the vlaues after pk2, can be any alias. This is just an example.
    pk1  pk2  MY1_DATE, MY2_DATE, MY3_DATE
    select *
         from pivot_tab
        PIVOT ( max(myElementDate) for myElement
                in (''MY1','MY2','MY3'))
    I saw a couple of references to this syntax, but I get syntax errors.
    ora--00906: missing parentheses. So I dont think this syntax works.
    select *
         from pivot_tab
        PIVOT ( max(myElementDate) for (pk1,pk2,myElement)
                in (''MY1','MY2','MY3'))Edited by: Guess2 on May 6, 2013 6:50 AM

    don't have any sample data or expected results to test this with maybe
    SELECT *
      FROM (SELECT pk1,
                   pk2,
                   myelement,
                   myelementdate
              FROM pivot_tab) PIVOT (MAX (myElementDate)
                              FOR myElement
                              IN ('MY1' AS MY1, 'MY2' AS MY2, 'MY3' AS MY3));or maybe you are trying to pivot by the first part of the pk?
    with pivot_tab as (select 1 pk1, 2 pk2, 'MY1' myelement, sysdate myelementdate from dual union all
                       select  1 pk1, 3 pk2, 'MY2' myelement, add_months(sysdate,2) myelementdate from dual union all
                       select  1 pk1, 4 pk2, 'MY3' myelement, add_months(sysdate,3) myelementdate from dual union all
                       select 2 pk1, 5 pk2, 'MY1' myelement, sysdate myelementdate from dual union all
                       select  2 pk1, 6 pk2, 'MY2' myelement, add_months(sysdate,6) myelementdate from dual union all
                       select  2 pk1, 7 pk2, 'MY3' myelement, add_months(sysdate,7) myelementdate from dual )
    SELECT *
      FROM (SELECT pk1,
                   myelement,
                   myelementdate
              FROM pivot_tab) PIVOT (MAX (myElementDate)
                              FOR myElement
                              IN ('MY1' AS MY1, 'MY2' AS MY2, 'MY3' AS MY3));
    PK1     MY1     MY2     MY3
    1     5/6/2013 10:07:40 AM     7/6/2013 10:07:40 AM     8/6/2013 10:07:40 AM
    2     5/6/2013 10:07:40 AM     11/6/2013 10:07:40 AM     12/6/2013 10:07:40 AMEdited by: pollywog on May 6, 2013 10:08 AM

  • Extract Sql Query with Actual Parameters from Report

    Hi
    I am able to extract query from Crystal Report using the following code :
    ReportDocument.ReportClientDocument.RowSetController.GetSqlStatement(new GroupPath, out tmp);
    But the sql query retrieve comes in the following format :
    select name , trans_code, account_code from command_query.accounts
    where account_code = {?Command_query_Prompt0}  and effective_date < '{?Command_query_prompt1 }'
    The parameters which I m using in the reports are :
    Account_Code and Effective_Date .
    Why does my extracted sql translates it into {?Command_query_Prompt0} and '{?Command_query_prompt1 }' .
    Is there any way to map this to the actual parameter values ?
    OR
    Can we extract the query after assigning the values ?
    Any help is appreciated ... 
    Thanks
    Sanchet

    hi,
    You can create nested sql query with conditional parameters,
    For example
    Select Code From OITT Where Code IN (Select ItemCode From OITM
    Where ItemName LIKE '[%0]' + '%%')
    Edited by: Jeyakanthan A on Jun 9, 2009 12:31 PM

  • How to write sql query for counting pairs from below table??

    Below is my SQL table structure.
    user_id | Name | join_side | left_leg | right_leg | Parent_id
    100001 Tinku Left 100002 100003 0
    100002 Harish Left 100004 100005 100001
    100003 Gorav Right 100006 100007 100001
    100004 Prince Left 100008 NULL 100002
    100005 Ajay Right NULL NULL 100002
    100006 Simran Left NULL NULL 100003
    100007 Raman Right NULL NULL 100003
    100008 Vijay Left NULL NULL 100004
    It is a binary table structure.. Every user has to add two per id under him, one is left_leg and second is right_leg... Parent_id is under which user current user is added.. Hope you will be understand..
    I have to write sql query for counting pairs under id "100001". i know there will be important role of parent_id for counting pairs. * what is pair( suppose if any user contains  both left_leg and right_leg id, then it is called pair.)
    I know there are three pairs under id "100001" :-
    1.  100002 and 100003
    2.  100004 and 100005
    3.  100006 and 100007
        100008 will not be counted as pair because it does not have right leg..
     But i dont know how to write sql query for this... Any help will be appreciated... This is my college project... And tommorow is the last date of submission.... Hope anyone will help me...
    Suppose i have to count pair for id '100002'. Then there is only one pair under id '100002'. i.e 100004 and 100005

    Sounds like this to me
    DECLARE @ID int
    SET @ID = 100001--your passed value
    SELECT left_leg,right_leg
    FROM table
    WHERE (user_id = @ID
    OR parent_id = @ID)
    AND left_leg IS NOT NULL
    AND right_leg IS NOT NULL
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • OIM 11g sql query

    HI all,
    Please help me with a SQL query which fetches all users with a specific resource in provisioning state in OIM 11g.
    Thanks.

    Hi Gyan,
    Thankyou it helped us a lot.
    But I started working with OIM apis but I am not aware of the back end flow.
    lets say when a user is being created, a request being raised untill approved, or a resource is provisioned ...I want to know what keys will generated and where they gets stored.
    It would be very helpful for me if u explain and explain some more scenrios.
    Thanks in advance.

  • SQL query to retrieve totals from "supporting Details"

    We've had a strange issue where the totals from the supporting details aren't adding up to the value submitted in essbase.
    In effect our RDMS is out of sync with Planning.
    In order to remedy this, I'm trying to build a SQL query to retrieve the value of the supporting details.
    Here is my Sql statement so far :
    SELECT
    HO1.OBJECT_NAME SCENARIO,
    HO2.OBJECT_NAME ACCOUNT,
    HO3.OBJECT_NAME ENTITY,
    HO4.OBJECT_NAME Month,
    HO5.OBJECT_NAME Version,
    HO6.OBJECT_NAME Currency,
    HO7.OBJECT_NAME Year,
    HO8.OBJECT_NAME Project,
    HO10.OBJECT_NAME CC,
    HO12.OBJECT_NAME Grplcl,
    HO13.OBJECT_NAME Product,
    HO15.OBJECT_NAME SalesRegion,
    HO16.OBJECT_NAME ContractAnalysis,
    HO17.OBJECT_NAME IC,
    SUM(NVL(HCDI.VALUE,0)) AMOUNT
    FROM hsp_column_detail HCD,
    hsp_column_detail_ITEM HCDI,
    HSP_OBJECT HO1,
    HSP_OBJECT HO2,
    HSP_OBJECT HO3,
    HSP_OBJECT HO4,
    HSP_OBJECT HO5,
    HSP_OBJECT HO6,
    HSP_OBJECT HO7,
    HSP_OBJECT HO8,
    HSP_OBJECT HO10,
    HSP_OBJECT HO12,
    HSP_OBJECT HO13,
    HSP_OBJECT HO15,
    HSP_OBJECT HO16,
    HSP_OBJECT HO17
    WHERE hcd.detail_id = hcdi.detail_id
    AND hcd.dim1 = ho1.object_id
    AND hcd.dim2 = ho2.object_id
    AND hcd.dim3 = ho3.object_id
    AND hcd.dim4 = ho4.object_id
    AND hcd.dim5 = ho5.object_id
    AND hcd.dim6 = ho6.object_id
    AND hcd.dim7 = ho7.object_id
    AND hcd.dim8 = ho8.object_id
    AND hcd.dim10 = ho10.object_id
    AND hcd.dim12 = ho12.object_id
    AND hcd.dim13 = ho13.object_id
    AND hcd.dim15 = ho15.object_id
    AND hcd.dim16 = ho16.object_id
    AND hcd.dim17 = ho17.object_id
    and hcdi.generation = 0
    GROUP BY HO1.OBJECT_NAME, HO2.OBJECT_NAME, HO3.OBJECT_NAME, HO4.OBJECT_NAME,
    HO5.OBJECT_NAME,
    HO6.OBJECT_NAME,
    HO7.OBJECT_NAME,
    HO8.OBJECT_NAME,
    HO10.OBJECT_NAME,
    HO12.OBJECT_NAME,
    HO13.OBJECT_NAME,
    HO15.OBJECT_NAME,
    HO16.OBJECT_NAME,
    HO17.OBJECT_NAME
    ORDER BY HO1.OBJECT_NAME, HO3.OBJECT_NAME, HO2.OBJECT_NAME

    This query works using PL SQL and has been used on Oracle 9.2.3.
    Cheers,
    Jeremie
    Here is the Query:
    set serveroutput on;
    set serveroutput on size 1000000;
    --set buffer_size 10000000;
    --set line_size 2000;
    --DBMS_OUTPUT.size = 2000000;
    DECLARE
    CURSOR BUDGET_HEADERS_CU IS
    SELECT
    hcd.detail_id,
    HO1.OBJECT_NAME SCENARIO,
    HO2.OBJECT_NAME ACCOUNT,
    HO3.OBJECT_NAME ENTITY,
    HO4.OBJECT_NAME Month,
    HO5.OBJECT_NAME Version,
    HO6.OBJECT_NAME Currency,
    HO7.OBJECT_NAME Year,
    HO8.OBJECT_NAME Project,
    HO10.OBJECT_NAME CC,
    HO12.OBJECT_NAME Grplcl,
    HO13.OBJECT_NAME Product,
    HO15.OBJECT_NAME SalesRegion,
    HO16.OBJECT_NAME ContractAnalysis,
    HO17.OBJECT_NAME IC,
    hcd.dim1 SCENARIO_id,
    hcd.dim2 ACCOUNT_id,
    hcd.dim3 ENTITY_id,
    hcd.dim4 Month_id,
    hcd.dim5 Version_id,
    hcd.dim6 Currency_ID,
    hcd.dim7 Year_ID,
    hcd.dim8 Project_ID,
    hcd.dim10 CC_ID,
    hcd.dim12 Grplcl_ID,
    hcd.dim13 Product_ID,
    hcd.dim15 SalesRegion_ID,
    hcd.dim16 ContractAnalysis_ID,
    hcd.dim17 IC_ID
    FROM hsp_column_detail HCD, /*hsp_column_detail_item HCDi,*/
    HSP_OBJECT HO1,
    HSP_OBJECT HO2,
    HSP_OBJECT HO3,
    HSP_OBJECT HO4,
    HSP_OBJECT HO5,
    HSP_OBJECT HO6,
    HSP_OBJECT HO7,
    HSP_OBJECT HO8,
    HSP_OBJECT HO10,
    HSP_OBJECT HO12,
    HSP_OBJECT HO13,
    HSP_OBJECT HO15,
    HSP_OBJECT HO16,
    HSP_OBJECT HO17
    WHERE /*hcd.detail_id = hcdi.detail_id
    AND*/ hcd.dim1 = ho1.object_id
    AND hcd.dim2 = ho2.object_id
    AND hcd.dim3 = ho3.object_id
    AND hcd.dim4 = ho4.object_id
    AND hcd.dim5 = ho5.object_id
    AND hcd.dim6 = ho6.object_id
    AND hcd.dim7 = ho7.object_id
    AND hcd.dim8 = ho8.object_id
    AND hcd.dim10 = ho10.object_id
    AND hcd.dim12 = ho12.object_id
    AND hcd.dim13 = ho13.object_id
    AND hcd.dim15 = ho15.object_id
    AND hcd.dim16 = ho16.object_id
    AND hcd.dim17 = ho17.object_id
    and HO5.OBJECT_NAME = 'Working'
    --and hcdi.generation != 0
    --and hcdi.label like 'JRTEST-%'
    --and hcd.detail_id = 253102
    /*GROUP BY HCD.Dim1, HCD.Dim2, HCD.Dim3, HCD.Dim4,
    HCD.Dim5,
    HCD.Dim6,
    HCD.Dim7,
    HCD.Dim8,
    HCD.Dim10,
    HCD.Dim12,
    HCD.Dim13,
    HCD.Dim15,
    HCD.Dim16,
    HCD.Dim17*/;
    CURSOR BUDGET_DETAILS_CU(
    /*scenario_p in varchar2,
    account_p in varchar2,
    entity_p in varchar2,
    month_p in varchar2,
    version_p in varchar2,
    currency_p in varchar2,
    year_p in varchar2,
    project_p in varchar2,
    cc_p in varchar2,
    grplcl_p in varchar2,
    product_p in varchar2,
    salesregion_p in varchar2,
    contractanalysis_p in varchar2,
    ic_p in varchar2*/
    detail_id_p in number
    IS
    SELECT
    /* HO1.OBJECT_NAME SCENARIO,
    HO2.OBJECT_NAME ACCOUNT,
    HO3.OBJECT_NAME ENTITY,
    HO4.OBJECT_NAME Month,
    HO5.OBJECT_NAME Version,
    HO6.OBJECT_NAME Currency,
    HO7.OBJECT_NAME Year,
    HO8.OBJECT_NAME Project,
    HO10.OBJECT_NAME CC,
    HO12.OBJECT_NAME Grplcl,
    HO13.OBJECT_NAME Product,
    HO15.OBJECT_NAME SalesRegion,
    HO16.OBJECT_NAME ContractAnalysis,
    HO17.OBJECT_NAME IC, */
    label,
    NVL(HCDI.VALUE,0) AMOUNT,
    HCDI.Position,
    HCDI.operator,
    HCDI.generation
    FROM /*hsp_column_detail HCD,*/
    hsp_column_detail_ITEM HCDI
    /* HSP_OBJECT HO1,
    HSP_OBJECT HO2,
    HSP_OBJECT HO3,
    HSP_OBJECT HO4,
    HSP_OBJECT HO5,
    HSP_OBJECT HO6,
    HSP_OBJECT HO7,
    HSP_OBJECT HO8,
    HSP_OBJECT HO10,
    HSP_OBJECT HO12,
    HSP_OBJECT HO13,
    HSP_OBJECT HO15,
    HSP_OBJECT HO16,
    HSP_OBJECT HO17*/
    --WHERE hcd.detail_id = hcdi.detail_id
    WHERE hcdi.detail_id = detail_id_p
    /*AND hcd.dim1 = ho1.object_id
    AND hcd.dim2 = ho2.object_id
    AND hcd.dim3 = ho3.object_id
    AND hcd.dim4 = ho4.object_id
    AND hcd.dim5 = ho5.object_id
    AND hcd.dim6 = ho6.object_id
    AND hcd.dim7 = ho7.object_id
    AND hcd.dim8 = ho8.object_id
    AND hcd.dim10 = ho10.object_id
    AND hcd.dim12 = ho12.object_id
    AND hcd.dim13 = ho13.object_id
    AND hcd.dim15 = ho15.object_id
    AND hcd.dim16 = ho16.object_id
    AND hcd.dim17 = ho17.object_id*/
    --and hcdi.generation != 0
    --and label like 'JRTEST-%'
    /*AND HCD.Dim1 = scenario_p
    AND HCD.Dim2 = account_p
    AND HCD.Dim3 = entity_p
    AND HCD.Dim4 = month_p
    AND HCD.Dim5 = version_p
    AND HCD.Dim6 = currency_p
    AND HCD.Dim7 = year_p
    AND HCD.Dim8 = project_p
    AND HCD.Dim10 = cc_p
    AND HCD.Dim12 = grplcl_p
    AND HCD.Dim13 = product_p
    AND HCD.Dim15 = salesregion_p
    AND HCD.Dim16 = contractanalysis_p
    AND HCD.Dim17 = ic_p*/
    ORDER BY hcdi.position;
    -- Variable Declaration
    running_total_ln number :=0;
    prev_running_total_ln number :=0;
    add_amount number :=0;
    multiply_amount number :=1;
    prev_generation number :=0;
    prev_add_amount number :=0;
    prev_multiply_amount number :=1;
    running_total_gen0 number :=0;
    running_gen0_op number :=0;
    running_total_gen1 number :=0;
    running_gen1_op number :=0;
    running_total_gen2 number :=0;
    running_gen2_op number :=0;
    running_total_gen3 number :=0;
    running_gen3_op number :=0;
    running_total_gen4 number :=0;
    running_gen4_op number :=0;
    running_total_gen5 number :=0;
    running_gen5_op number :=0;
    output_file utl_file.file_type;
    -- Begin PL/SQL processing
    BEGIN
    --DBMS_OUTPUT.
    DBMS_OUTPUT.ENABLE(1000000);
    DBMS_OUTPUT.PUT_LINE('Begin Processing');
    output_file := utl_file.fopen ('C:\temp', 'test.txt', 'W');
    -- Begin Header For Loop
    FOR BUDGET_HEADERS_CV IN BUDGET_HEADERS_CU
    LOOP
    --Reset Running Totals
    running_total_ln:=0;
    prev_running_total_ln:=0;
    add_amount:=0;
    multiply_amount:=1;
    prev_generation:=0;
    prev_add_amount:=0;
    prev_multiply_amount:=1;
    running_total_gen0:=0;
    running_gen0_op:=0;
    running_total_gen1:=0;
    running_gen1_op:=0;
    running_total_gen2:=0;
    running_gen2_op:=0;
    running_total_gen3:=0;
    running_gen3_op:=0;
    running_total_gen4:=0;
    running_gen4_op:=0;
    running_total_gen5:=0;
    running_gen5_op:=0;
    -- Begin Detail For Loop
    FOR BUDGET_DETAILS_CV IN BUDGET_DETAILS_CU(
    BUDGET_HEADERS_CV.Detail_ID
    /*BUDGET_HEADERS_CV.SCENARIO_ID,
    BUDGET_HEADERS_CV.ACCOUNT_ID,
    BUDGET_HEADERS_CV.ENTITY_ID,
    BUDGET_HEADERS_CV.Month_ID,
    BUDGET_HEADERS_CV.Version_ID,
    BUDGET_HEADERS_CV.Currency_ID,
    BUDGET_HEADERS_CV.Year_ID,
    BUDGET_HEADERS_CV.Project_ID,
    BUDGET_HEADERS_CV.CC_ID,
    BUDGET_HEADERS_CV.Grplcl_ID,
    BUDGET_HEADERS_CV.Product_ID,
    BUDGET_HEADERS_CV.SalesRegion_ID,
    BUDGET_HEADERS_CV.ContractAnalysis_ID,
    BUDGET_HEADERS_CV.IC_ID*/
    LOOP
    -- Null;
    add_amount :=0;
    multiply_amount :=1;
    IF BUDGET_DETAILS_CV.OPERATOR = 1 THEN
    add_amount := BUDGET_DETAILS_CV.Amount;
    End if;
    IF BUDGET_DETAILS_CV.OPERATOR = 2 THEN
    add_amount := BUDGET_DETAILS_CV.Amount * -1;
    End if;
    IF BUDGET_DETAILS_CV.OPERATOR = 3 THEN
    multiply_amount := BUDGET_DETAILS_CV.Amount;
    End if;
    IF BUDGET_DETAILS_CV.OPERATOR = 4 THEN
    multiply_amount := 1/BUDGET_DETAILS_CV.Amount;
    End if;
    IF BUDGET_DETAILS_CV.Position = 0 then
    running_total_gen0 := add_amount*multiply_amount;-- we are dealing with the first line
    Else
    if BUDGET_DETAILS_CV.GENERATION = prev_generation then
    -- run whatever total we are on up
    if BUDGET_DETAILS_CV.GENERATION = 0 then
    running_total_gen0 := (running_total_gen0 + add_amount)*multiply_amount;
    end if;
    if BUDGET_DETAILS_CV.GENERATION = 1 then
    running_total_gen1 := (running_total_gen1 + add_amount)*multiply_amount;
    end if;
    if BUDGET_DETAILS_CV.GENERATION = 2 then
    running_total_gen2 := (running_total_gen2 + add_amount)*multiply_amount;
    end if;
    if BUDGET_DETAILS_CV.GENERATION = 3 then
    running_total_gen3 := (running_total_gen3 + add_amount)*multiply_amount;
    end if;
    end if;
    if BUDGET_DETAILS_CV.GENERATION = prev_generation +1 then
    -- we are going up a generation
    -- (we cannot go up to gen0
    if BUDGET_DETAILS_CV.GENERATION = 1 then
    running_total_gen1:=0;-- reset gen1 counter
    running_gen0_op:=BUDGET_DETAILS_CV.OPERATOR; -- Store the sign for later operation
    running_total_gen0 := running_total_gen0/prev_multiply_amount - prev_add_amount; -- Remove parent from Gen 0 total
    running_total_gen1 := (running_total_gen1 + add_amount)*multiply_amount;
    end if;
    if BUDGET_DETAILS_CV.GENERATION = 2 then
    running_total_gen2:=0;-- reset gen1 counter
    running_gen1_op:=BUDGET_DETAILS_CV.OPERATOR; -- Store the sign for later operation
    running_total_gen1 := running_total_gen1/prev_multiply_amount - prev_add_amount; -- Remove parent from Gen 1 total
    running_total_gen2 := (running_total_gen2 + add_amount)*multiply_amount;
    end if;
    if BUDGET_DETAILS_CV.GENERATION = 3 then
    running_total_gen3:=0;-- reset gen1 counter
    running_gen2_op:=BUDGET_DETAILS_CV.OPERATOR; -- Store the sign for later operation
    running_total_gen2 := running_total_gen2/prev_multiply_amount - prev_add_amount; -- Remove parent from Gen 2 total
    running_total_gen3 := (running_total_gen3 + add_amount)*multiply_amount;
    end if;
    end if;
    if BUDGET_DETAILS_CV.GENERATION = prev_generation - 1 then
    -- we are Down a generation
    if BUDGET_DETAILS_CV.GENERATION = 0 then
    --we need to "add" back the previous gen 1 parent
    IF running_gen0_op = 1 THEN
    running_total_gen0 := running_total_gen0 + running_total_gen1;
    End if;
    IF running_gen0_op = 2 THEN
    running_total_gen0 := running_total_gen0 - running_total_gen1;
    End if;
    IF running_gen0_op = 3 THEN
    running_total_gen0 := running_total_gen0 * running_total_gen1;
    End if;
    IF running_gen0_op = 4 THEN
    running_total_gen0 := running_total_gen0 / running_total_gen1;
    End if;
    -- we need to add the current member to the gen0
    running_total_gen0 := (running_total_gen0 + add_amount)*multiply_amount;
    END IF;
    if BUDGET_DETAILS_CV.GENERATION = 1 then
    --we need to "add" back the previous gen 2 parent
    IF running_gen1_op = 1 THEN
    running_total_gen1 := running_total_gen1 + running_total_gen2;
    End if;
    IF running_gen1_op = 2 THEN
    running_total_gen1 := running_total_gen1 - running_total_gen2;
    End if;
    IF running_gen1_op = 3 THEN
    running_total_gen1 := running_total_gen1 * running_total_gen2;
    End if;
    IF running_gen1_op = 4 THEN
    running_total_gen1 := running_total_gen1 / running_total_gen2;
    End if;
    -- we need to add the current member to the gen1
    running_total_gen1 := (running_total_gen1 + add_amount)*multiply_amount;
    end if;
    if BUDGET_DETAILS_CV.GENERATION = 2 then
    --we need to "add" back the previous gen 3 parent
    IF running_gen1_op = 1 THEN
    running_total_gen2 := running_total_gen2 + running_total_gen3;
    End if;
    IF running_gen1_op = 2 THEN
    running_total_gen2 := running_total_gen2 - running_total_gen3;
    End if;
    IF running_gen1_op = 3 THEN
    running_total_gen2 := running_total_gen2 * running_total_gen3;
    End if;
    IF running_gen1_op = 4 THEN
    running_total_gen2 := running_total_gen2 / running_total_gen3;
    End if;
    -- we need to add the current member to the gen2
    running_total_gen2 := (running_total_gen2 + add_amount)*multiply_amount;
    end if;
    end if;
    if BUDGET_DETAILS_CV.GENERATION = prev_generation - 2 then
    -- we are Down 2 generations
    if BUDGET_DETAILS_CV.GENERATION = 0 then
    --we need to "add" back the previous gen 2 parent
    IF running_gen1_op = 1 THEN
    running_total_gen1 := running_total_gen1 + running_total_gen2;
    End if;
    IF running_gen1_op = 2 THEN
    running_total_gen1 := running_total_gen1 - running_total_gen2;
    End if;
    IF running_gen1_op = 3 THEN
    running_total_gen1 := running_total_gen1 * running_total_gen2;
    End if;
    IF running_gen1_op = 4 THEN
    running_total_gen1 := running_total_gen1 / running_total_gen2;
    End if;
    --we need to "add" back the previous gen 1 parent
    IF running_gen0_op = 1 THEN
    running_total_gen0 := running_total_gen0 + running_total_gen1;
    End if;
    IF running_gen0_op = 2 THEN
    running_total_gen0 := running_total_gen0 - running_total_gen1;
    End if;
    IF running_gen0_op = 3 THEN
    running_total_gen0 := running_total_gen0 * running_total_gen1;
    End if;
    IF running_gen0_op = 4 THEN
    running_total_gen0 := running_total_gen0 / running_total_gen1;
    End if;
    -- we need to add the current member to the gen0
    running_total_gen0 := (running_total_gen0 + add_amount)*multiply_amount;
    END IF;
    if BUDGET_DETAILS_CV.GENERATION = 1 then
    --we need to "add" back the previous gen 3 parent
    IF running_gen1_op = 1 THEN
    running_total_gen2 := running_total_gen2 + running_total_gen3;
    End if;
    IF running_gen1_op = 2 THEN
    running_total_gen2 := running_total_gen2 - running_total_gen3;
    End if;
    IF running_gen1_op = 3 THEN
    running_total_gen2 := running_total_gen2 * running_total_gen3;
    End if;
    IF running_gen1_op = 4 THEN
    running_total_gen2 := running_total_gen2 / running_total_gen3;
    End if;
    --we need to "add" back the previous gen 2 parent
    IF running_gen1_op = 1 THEN
    running_total_gen1 := running_total_gen1 + running_total_gen2;
    End if;
    IF running_gen1_op = 2 THEN
    running_total_gen1 := running_total_gen1 - running_total_gen2;
    End if;
    IF running_gen1_op = 3 THEN
    running_total_gen1 := running_total_gen1 * running_total_gen2;
    End if;
    IF running_gen1_op = 4 THEN
    running_total_gen1 := running_total_gen1 / running_total_gen2;
    End if;
    -- we need to add the current member to the gen1
    running_total_gen1 := (running_total_gen1 + add_amount)*multiply_amount;
    END IF;
    if BUDGET_DETAILS_CV.GENERATION = prev_generation - 3 then
    -- we are Down 3 generations
    if BUDGET_DETAILS_CV.GENERATION = 0 then
    --we need to "add" back the previous gen 3 parent
    IF running_gen1_op = 1 THEN
    running_total_gen2 := running_total_gen2 + running_total_gen3;
    End if;
    IF running_gen1_op = 2 THEN
    running_total_gen2 := running_total_gen2 - running_total_gen3;
    End if;
    IF running_gen1_op = 3 THEN
    running_total_gen2 := running_total_gen2 * running_total_gen3;
    End if;
    IF running_gen1_op = 4 THEN
    running_total_gen2 := running_total_gen2 / running_total_gen3;
    End if;
    --we need to "add" back the previous gen 2 parent
    IF running_gen1_op = 1 THEN
    running_total_gen1 := running_total_gen1 + running_total_gen2;
    End if;
    IF running_gen1_op = 2 THEN
    running_total_gen1 := running_total_gen1 - running_total_gen2;
    End if;
    IF running_gen1_op = 3 THEN
    running_total_gen1 := running_total_gen1 * running_total_gen2;
    End if;
    IF running_gen1_op = 4 THEN
    running_total_gen1 := running_total_gen1 / running_total_gen2;
    End if;
    --we need to "add" back the previous gen 1 parent
    IF running_gen0_op = 1 THEN
    running_total_gen0 := running_total_gen0 + running_total_gen1;
    End if;
    IF running_gen0_op = 2 THEN
    running_total_gen0 := running_total_gen0 - running_total_gen1;
    End if;
    IF running_gen0_op = 3 THEN
    running_total_gen0 := running_total_gen0 * running_total_gen1;
    End if;
    IF running_gen0_op = 4 THEN
    running_total_gen0 := running_total_gen0 / running_total_gen1;
    End if;
    -- we need to add the current member to the gen0
    running_total_gen0 := (running_total_gen0 + add_amount)*multiply_amount;
    END IF;
    end if;
    END IF;
    End IF;
    END LOOP; -- End of Detail Loop
    --DBMS_OUTPUT.PUT_LINE(BUDGET_HEADERS_CV.SCENARIO||';'||BUDGET_HEADERS_CV.ACCOUNT||';'||BUDGET_HEADERS_CV.ENTITY||';'||BUDGET_HEADERS_CV.Month||';'||BUDGET_HEADERS_CV.Version||';'||BUDGET_HEADERS_CV.Currency||';'||BUDGET_HEADERS_CV.Year||';'||BUDGET_HEADERS_CV.Project||';'||BUDGET_HEADERS_CV.CC||';'||BUDGET_HEADERS_CV.Grplcl||';'||BUDGET_HEADERS_CV.Product||';'||BUDGET_HEADERS_CV.SalesRegion||';'||BUDGET_HEADERS_CV.ContractAnalysis||';'||BUDGET_HEADERS_CV.IC||';'||running_total_gen0);
    utl_file.put_line(output_file,BUDGET_HEADERS_CV.SCENARIO||';'||BUDGET_HEADERS_CV.ACCOUNT||';'||BUDGET_HEADERS_CV.ENTITY||';'||BUDGET_HEADERS_CV.Month||';'||BUDGET_HEADERS_CV.Version||';'||BUDGET_HEADERS_CV.Currency||';'||BUDGET_HEADERS_CV.Year||';'||BUDGET_HEADERS_CV.Project||';'||BUDGET_HEADERS_CV.CC||';'||BUDGET_HEADERS_CV.Grplcl||';'||BUDGET_HEADERS_CV.Product||';'||BUDGET_HEADERS_CV.SalesRegion||';'||BUDGET_HEADERS_CV.ContractAnalysis||';'||BUDGET_HEADERS_CV.IC||';'||running_total_gen0);
    /*BUDGET_HEADERS_CV.SCENARIO, BUDGET_HEADERS_CV.ACCOUNT, BUDGET_HEADERS_CV.ENTITY, BUDGET_HEADERS_CV.Month, BUDGET_HEADERS_CV.Version,BUDGET_HEADERS_CV.Currency, BUDGET_HEADERS_CV.Year, BUDGET_HEADERS_CV.Project, BUDGET_HEADERS_CV.CC, BUDGET_HEADERS_CV.Grplcl, BUDGET_HEADERS_CV.Product, BUDGET_HEADERS_CV.SalesRegion, BUDGET_HEADERS_CV.ContractAnalysis, BUDGET_HEADERS_CV.IC */
    END LOOP; -- End of Header Loop
    --DBMS_OUTPUT.PUT_LINE('Total');
    -- DBMS_OUTPUT.PUT_LINE('End Processing');
    utl_file.fclose(output_file);
    END;
    Edited by: JeremieR on Apr 18, 2011 5:02 AM

  • Passing entire SQL query to BIP server from Forms

    Hi
    I want to pass the entire SQL statement or only a WHERE clause dynamically constructed on Forms side to BI Publisher server at runtime.
    I have come across this article:
    http://blogs.oracle.com/BIDeveloper/2009/12/dynamic_sql_query_in_data_template.html
    It mentions about using pwhereclause which could be constructed dynamically.
    Is it possible to pass the entire SELECT statement and has anyone done this before? May I have some tips on this?
    Thanks and kind regards,
    Aparna

    My requirement is as follows:
    1) I have a customised application which contains the definition of the report (report id, report name, the screen id on which the report is to appear as a record in the list and so on). This is where I would like to record the SQL statement which will be used to retrieve data for the report.
    2) Once I launch the report from my application, it will pass SQL statement and other data (template, format, output file name, path where the output file will be saved, URL from which the output file will be launched after saving).
    Thus, on BI Publisher server side, I shall only create a report, and will create a data template that will reference the SQL query that has been passed from application. I don't want to even specify parameters in Bi Publisher and want to specify them only in the application.
    Is this possible?
    Currently, I'm using a web service called 'PublicReportService' of BI Publisher to pass template, format, output file name, report path etc.). However, I am not sure how to pass an SQL query from Oracle Forms via this web service to BI Publisher.
    Can someone please guide me?
    Thanks and kind regards,
    Aparna

  • QAAWS query results differ from live office query results

    Hello,
    I ran a query in QAAWS using 3 filter components and got different results ( expected a single row and expected the query to sum up the values) Result was 4 dirrent rows for the the same combination
    eg)  A : B: C  value1
          A: B:C  value 2
         A:B:C   value3
        A:B:C    value 4.
    I expected A: B:C  (value1value2value3+Value4) .
    When I run the same query  in Live Office I get the correct single row.  Somehow the filter condition in QAAWS does not fetch accurate resuls, I removed the filter conditions and still got the same results. I am reviewing the results in the Xcelsius Dashboard.   Any thought on this issue. 
    Thanks
    Abhijit

    When you are using LO, the query result will be aggregated at report level, based on the aggregation you have selected for the Measure (Your Value). Hence you will get only 1 row. On the other hand QaaWS will not do any aggregation as it just output the querry result. IF you want QaaWS to output aggregated data, you will have to define your querry accordingly. For eg:(Assume that your are working with SQL based database), you can use Sum(Value) as the query defention for your measure.
    Hope this helps,
    Anil

Maybe you are looking for

  • My Mac Pro keeps restarting & I don't know why

    Hi, It's happened three times now, twice when I was asleep and once when I actually witnessed it happen. When I saw it happen, it was  as if someone had pulled the power plug out of the back, it was that quick.  I was typing along and suddenly zap, i

  • Can I run a BI Publisher report from interactive report

    Hi, I have an APEX interactive report and want to run a BI publisher report by clicking on a column value within the interactive report. Is that possible?

  • Can my need be solved with a group calendar or any other function in Exchange/Outlook?

    I will try to express our need for our "Project Office" and is interested in how this can be solved using Outlook/Exchange. Our Project Office is in charge of several Projects and the Project Office Manager is interested to have a single calendar vie

  • Why is Firefox asking for outbound DTN connections?

    Quite specifically, Firefox is requesting and outbound DTS connection. I don't need to allow this connection for Firefox to function normally as far as I can tell. Why is this happening. I have a fully updated Windows 7 64bit OS without java installe

  • Dual-stack approach

    Hi guys, In a dual stack network, how can we decide whether IPv4 or IPv6 address is used in a simulator software? How to test this? Thank you in advance.