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

Similar Messages

  • Creating Crystal Reports Dynamically from an incoming SQL query

    Hi,
    I have a requirement where a sql query will be entered by the user in a text box and in the back end java code, i have to create a crystal report dynamically based on that sql query and show it in the crystalviewer object.
    For example if the user writes "select x,y from xtable ", i should be able to create a report with 2 fields, and if the user says "select x,y,z from xtable" then i should be able create and show a report with 3 fileds...thsi report creation should be done in the click event.
    Is this possible in java? I have found something similar in .NET... pls have a look at this 
    http://vb.net-informations.com/crystal-report/dynamic_crystal_report_from_sql_query_string.htm
    Thanks,
    Preethi

    Hi Preethi,
    Can you please share the steps with me? I am also looking for dynamic SQL being applied to the crystal report.
    Thank you so much for your help in advance.
    Regards,
    Janakiram D.

  • Crystal Reports 10 Datasource Location and SQL Query update

    I am running Crystal Reports 10 accessing SQL Server 2008 database on Windows 7. Our product changed database names and I'm trying to update reports to point to the new database. Sounds nice and simple. The database has no structure changes yet, it's just a copy and rename of the old database. Both databases exist, same SQL instance, same permissions, etc. ...
    Existing working report:
       Has an ODBC (RDO) location to database DbVersion1
       If I run Show SQL Query, the database name is in the query text (i.e. FROM DbVersion1.dbo.MyTable)
    Attempted:
       In Set Database Location popup, I created a new ODBC (RDO) connection to database DbVersion2
       Updated Current Data Source for report to this new ODBC (RDO) connection.
       Ran Verify Database. Popup stated "The database is up to date."
    But when I run "Show SQL Query", is still shows DbVersion1 in the text, and the report displays data from DbVerison1. When I display the Datasource Location for the report, it shows DbVersion2 as I changed to above. How do I "refresh" the SQL Query to recognize the new Datasource Location?
    Thanks,
    Gary

    Hi Gary,
    A possible couple of issues, CR 10 doesn't support SQL Server 2008 and it doesn't support Windows 7. We had to update CR XI R2 SP 6 and above to make SQL 2008 work. MS changed the name of their client dll so CR is not aware of the new drivers.
    MDAC native driver may work but not sure....
    Try OLE DB, it may work better.
    Thanks
    Don

  • APEX validations in updateable reports built on a PL/SQL query

    Sorry if the question is not clear (english is not my mother language) or if the answer already exists on the forum (I have not been able to find it).
    I build a report on a PL/SQL function query.
    In this PL/SQL query i use apex_item.checkboxes or texts to let the end user change/enter some new data.
    As i need to do some validations on the user entries, i have already used some events (e.g. onChange) that trigger
    simple javascript validations checking if data is numeric or length of data entered....
    But i would like to use also the standard validations of APEX to make some more complex validations (e.g. checking coherency) on
    many data entered by the end user.
    I am trying to build a PL/SQL to loop through the report lines through a checkbox item i have added
    but the process of debugging is awfull for me.
    - Is there a pointer to a code example of validations within a query report that would help me in achieving this validation
    - or could someone give me some clue on how to acess these report data in the interface.
    Thanks in advance,
    Daniel

    Daniel:
    You can check out Denes Kubicek's APEX demo site for ideas on how to create validations for a tabular form.
    http://htmldb.oracle.com/pls/otn/f?p=31517:41:3322496527336906:::RP,::
    Varad

  • Report Column Headings based on SQL Query

    Hi ,
    I am working on creating a SQL query based report. However, my column headers for this report are stored in a table and hence, I need the column headers to be based on a sql query also.
    Can you give me some pointers on how to do this ?
    Thanks!
    Lavanya

    Lavanya,
    The report column attributes page has a radiogroup of column heading types. One lets you specify a PL/SQL function that returns the headings.
    Scott

  • Report in Answers using a SQL Query(Sub Query) URGENT

    HI
    Can anyone help me in creating a report in answers using this below query please. Its little Urgent. I have no idea how to implement this, please suggest.
    Select
    a.account_external_id, a.edc_external_id, c.ann_usg, indclassificationcode, g.usage_cv, trunc(g.bill_month, 'mm') bill_month
    from
    crm2ro.cdi_customer_gas_all a, pwrline.account@lodestar_source b, crm2ro.cdi_ann_usg c,
    select * FROM
    select * from
    select distinct d.account_external_id, d.end_date, d.bill_month, USAGE_CV, dense_rank () over (partition by d.account_external_id order by d.end_Date desc) dr
    from
    crm2ro.cdi_usage_gas_all d, crm2ro.cdi_customer_gas_all e
    where
    d.account_external_id = e.account_external_id and upper(e.plan_id) like '%CPS%' and e.product_external_id = 'V' and e.crm_product = 'MV'
    and (e.plan_id like '%VAR_CPS_MX_G%' or e.plan_id like '%VAR_CPS_IT_G%') and e.account_status = 'ACTIVE'
    )where dr<=12
    ) h
    ) g
    where
    a.account_external_id = g.account_external_id and
    a.account_external_id = c.account_external_id and
    a.account_external_id = b.accountid
    thanks
    van

    Yes Jai,
    I want to do it from rpd or from the advance tab as 974053 said. But I am not aware of doing through advance tab and if I want to do through rpd then how can I do it. Please help me how to build this query through rpd or any other solution.

  • SQL query - show integer number as text

    Hello,
    how can I reads data from the db that is either "-1" or "1" (it's define as integer)
    and display as 'YES' or 'NO' ?
    Thank you
    Gian

    Hi,
    You can also do this:
    select decode(<your_column>,-1,'YES','NO') from <your_table>;
    Peter D.

  • Report based on PLSQL returning SQL query

    I created function which builds the SQL and returns it as VARCHAR2. For testing purposes I harcoded the primary ID for the query to be based on. I run the function as standalone call to get the generated SQL and to test it. It works fine. The moment I try to use the ID parameter as an argument passed to the function it doesn't work and I get the "No data found" error. Again if I try this function outside of Apex it produces correct SQL syntax and it runs.
    The function signature is really simple:
    FUNCTION abc(i_id NUMBER) RETURN VARCHAR2
    IS
    l_id NUMBER;
    BEGIN
    -- this works:
    -- l_id := 300;
    -- this doesn't work:
    l_id := i_id;
    ... more code follows. It uses the l_id while building the query.
    I also tried to make it an anonymous block and place it directly in Apex region. Again I face the same problem. I modified this function slightly to reference the page attribute instead of accepting parameter:
    DECLARE
    l_id NUMBER;
    BEGIN
    -- this works:
    -- l_id := 300;
    -- this doesn't work:
    l_id := :P65_ID;

    Have you verified that i_id and P65_ID have a value when the procedure runs? Perhaps have something along the lines of "if i_id is null then return 'select <dummy data> from dual' else [build real query here]"...?
    -D.

  • Generating report based on dynamically generated sql query

    I have to rewrite asp reports to oracle reports.
    The original application has forms in asp where reports are generated dynamically based on the options selected.
    There are many options to select.
    Some add filter criteria to where clause.
    I have no problem with this. As i can generate report using parameter form.
    whereas i don't know how to generate reports whose columns change based on the user selection.
    The front end screens are going to be in java and jsp pages. The only way i can think of is generating reports on all possible options the user may select. But, as there are more than 15 options, i think this is not the right approach.
    How can i achieve this.
    Thank you very much.
    navya.

    One method that comes to mind would be to use an after parameter form, and use lexical parameters to create dynamic statements.
    For example in your after pform:
    If :P_NAME = 'JOHN' then
    :P_SELECT = 'SELECT COL1, COL2 ';
    :P_FROM = 'FROM JOHN ';
    :P_WHERE = 'WHERE COL3 = 'JOHN';
    END IF;
    Then in your query, you could say:
    &P_SELECT
    &P_FROM
    &P_WHERE
    Something like that - If only parts of you where statement will change, you can just write that one part -
    like
    IF :P_STATE is not null then
    :P_STATE = ' and table.state = :P_STATE_IN ';
    else :P_STATE = ' and 1=1 ';
    end if;
    and in your query...
    where....
    &:P_STATE
    So IF a person enters a state, then limit the search to that state, or else do a 1=1.
    Hope this gives you a start

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

  • Discoverer Report - SQL Query to retrieve list of parameters

    Hi
    We have around 100 Discoverer reports and I'm trying to find the list of parameters used in each report.
    Is there any SQL query that I can use to find the parameters used for each report
    or
    should I open the reports one by one to fetch the list of parameters used.
    I checked the tables in EUL4_US schema but no luck.
    - Amarnath.K

    give this a try for starters. It looks at the custom folders defined in the business area, which is where any LOV's defined for you parameters would be. As far as looking at the workbooks themselves, no, there is no way to do that in sql.
    select
    decode(eb.ba_created_by,'ORACLE_APPS','Seeded','Custom') Origin,
    eb.ba_name business_area,
    eo.OBJ_TYPE,
    decode(eo.obj_type, 'SOBJ','From Database', 'CUO', 'Custom Query', 'COBJ', 'Complex Folder', eo.obj_type) obj_type_desc,
    eo.OBJ_NAME folder,
    eo.OBJ_DESCRIPTION folder_description,
    decode(eo.sobj_ext_table, NULL, NULL, eo.obj_ext_owner || '.' || eo.sobj_ext_table) base_object,
    decode(es.seg_obj_id, null, UPPER(trim(eo.obj_object_sql1)||trim(eo.obj_object_sql2)||trim(eo.obj_object_sql3))
    , UPPER(trim(es.seg_chunk1) || trim(es.seg_chunk2) || trim(es.seg_chunk3) || trim(es.seg_chunk4))) SQL
    from
    eul4_us.EUL5_BAS eb,
    eul4_us.EUL5_objs eo,
    eul4_us.EUL5_BA_OBJ_LINKS ebol,
    eul4_us.eul5_segments es
    where
    eb.BA_ID = ebol.BOL_BA_ID and
    ebol.BOL_OBJ_ID = eo.OBJ_ID and
    eo.obj_id = es.seg_obj_id (+) and
    decode(eb.ba_created_by,'ORACLE_APPS','Seeded','Custom') = 'Custom'
    order by
    /*decode(eb.ba_created_by,'ORACLE_APPS','Seeded','Custom'), */eb.ba_name, ebol.BOL_SEQUENCE, es.seg_sequence

  • Need to adjust SQL query for left outer join in Crystal Reports 2008.

    I need to change this SQL 2005 query.....
    SELECT     omnicell_anl.DeviceIDsLastMetricTable.member_id, omnicell_anl.DeviceIDsLastMetricTable.[Device Name],
                          omnicell_anl.DeviceIDsLastMetricTable.Account, omnicell_anl.labeledLastMetrics.PROPERTY_NAME,
                          omnicell_anl.labeledLastMetrics.latest_monitor_value
    FROM         omnicell_anl.DeviceIDsLastMetricTable LEFT OUTER JOIN
                          omnicell_anl.labeledLastMetrics ON omnicell_anl.DeviceIDsLastMetricTable.member_id = omnicell_anl.labeledLastMetrics.member_id
    WHERE
        omnicell_anl.labeledLastMetrics.PROPERTY_NAME = ?MyProperty
    To this query in Crystal Reports Report Writer:
    SELECT     omnicell_anl.DeviceIDsLastMetricTable.member_id, omnicell_anl.DeviceIDsLastMetricTable.[Device Name],
                          omnicell_anl.DeviceIDsLastMetricTable.Account, omnicell_anl.labeledLastMetrics.PROPERTY_NAME,
                          omnicell_anl.labeledLastMetrics.latest_monitor_value
    FROM         omnicell_anl.DeviceIDsLastMetricTable LEFT OUTER JOIN
                          omnicell_anl.labeledLastMetrics ON omnicell_anl.DeviceIDsLastMetricTable.member_id = omnicell_anl.labeledLastMetrics.member_id AND
                          omnicell_anl.labeledLastMetrics.PROPERTY_NAME = ?MyProperty
    I can't seem to get the left outer join function of Crystal Reports to emulate the same SQL query in SQL 2005.  Any ideas on how I can create this same query in Crystal 2008?
    Thanks,
    Dominic
    Edited by: Dominic Carissimi on Oct 28, 2008 7:55 PM
    Edited by: Dominic Carissimi on Oct 28, 2008 7:56 PM

    If you want the list of values for command level parameter then you need to add another command like
    select PropertyField from table
    and delete the links between this command and the existing command.
    Now go to field explorer and edit the command level parameter and make it as dynamic and add the property field from newly added command.
    Hope this helps!
    Raghavendra

  • Help with PL/SQL returning SQL query for Report

    Hi
    I have got a report which I have formatted as PL/SQL function body returning SQL query.
    I have the following code
    declare
    q VARCHAR2(32000); -- query
    w VARCHAR2(4000) ; -- where clause
    begin
    q := 'select min(identified_date) first_identified,' ||
    ' max(actual_resolution_date) last_closed,' ||
    ' count("HELPDESK_CALL_ID) total_issues,' ||
    ' from tbl_helpdesk_calls';
    if :P9_call_type != '-1' then
    w := 'HELPDESK_CALL_TYPE_ID = :P9_call_type';
    end if;
    q := q || ' WHERE '|| w;
    return q;
    end;
    When I apply changes I get this error message
    Query cannot be parsed within the Builder. If you believe your query is syntactically correct, check the ''generic columns'' checkbox below the region source to proceed without parsing. ORA-00972: identifier is too long
    Any Idea where I maybe going wrong?

    thanks its compiling now but when I run the page I get this error message in the reports region
    failed to parse SQL query:
    ORA-00933: SQL command not properly ended
    This is my code that I have at the momment.
    declare
    q VARCHAR2(32000); -- query
    w VARCHAR2(4000) ; -- where clause
    we VARCHAR2(1) := 'N'; -- identifies if where clause exists
    begin
    q := 'select min(identified_date) first_identified,' ||
    ' max(actual_resolution_date) last_closed,' ||
    ' count(HELPDESK_CALL_ID) total_issues,' ||
    ' sum(decode(status,''Open'',1,0)) open_issues, ' ||
    ' sum(decode(status,''On-Hold'',1,0)) onhold_issues,' ||
    ' sum(decode(status,''Closed'',1,0)) closed_issues,' ||
    ' sum(decode(status,''Open'',decode
    (priority,''High'',1,0),0)) open_high_prior,' ||
    ' sum(decode(status,''Open'',decode
    (priority,''Medium'',1,0),0)) open_medium_prior, '||
    ' sum(decode(status,''Open'',decode
    (priority,''Low'',1,0),0)) open_low_prior '||
    ' from tbl_helpdesk_calls';
    if :P9_call_type != '-1' then
    w := 'where HELPDESK_CALL_TYPE_ID = :P9_call_type';
    we := 'Y';
    end if;
    if we = 'Y' then
    q := q ||w;
    end if;
    return q;
    end;
    I have a select list with a list of reports. what I am trying to do build an sql depending on what the :p9_call_type value is. -1 represents the display value of -All Reports- so if the user selects all reports it should display all results thus removing the where clause. However as my code stands when I user clicks on all reports he get the correct results for all reports. If the user selects anything else they get the error message above.

  • Failed to parse SQL query by one user

    Hi all,
    in my app i have a text-item with a submit button. In this item i type a name and a report after the item-region show me the result(s). this works for all my users (>2000) perfectly, but one of this users become an error in the report-region:
    failed to parse SQL query:
    ORA-01403: no data found
    We try this with the same searchstring on the same computer/browser. If i logged in the result is ok, if the user logged in, the error message shows. If i try this on the computer from the user with me logged in, result ok. If the user try this on an other pc, results error.
    I have an productive and a developer workspace. In the developer workspace the user can try this perfectly without errors. Only in the productive workspace the error shows.
    The SQL-Select in the reprirt ist verry simple:
    select id
    , name
    , raum
    from table
    where instr(upper(name), upper(:P60_SEARCH))>0
    However all users can use this search-field with report perfectly, only this one user has the error. It is no restrictions on this item or report.
    Can anybody help me?

    Carsten,
    user preferences do not have anything to do with the fact where the user resides (apex built in, LDAP, whatever). User Preferences are saved for a named user and they are loaded next time the same user loggs in. For example, if you sort your report on a column x, apex will save this as a setting and next time you call the same report, this report will be sorted the same way. Since you don't have a permission to edit services, you should check your adminstrative permissions and conntact the real administrator of the workspace to do that "purge prefference" for you. I could bet this is the reason you are getting that strange error message.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    ------------------------------------------------------------------------------

  • Help Modifying SQL Query

    We just upgraded from Crystal Reports 8.0 to 2008 and are unable to modify the SQL query for any of our old Crystal Report files.  I can view the query by going to "Database", "Show SQL Query..." but am unable to edit the SQL statement in any way.
    If there a setting within "Options" or anywhere else that has this locked?  Is there another place with the application that allows me to edit the SQL Query?  I looked at the "Select Expert" but none of my WHERE elements show up there.

    The SQL query cannot be modified. (It is my understanding that you could in older versions... Not sure in which version that changed.)
    The latest versions of CR allow the use of SQL Commands. SQL Commands allow you to "paste" the SQL generated by CR and modify it or write your own SQL from scratch.
    HTH,
    Jason

Maybe you are looking for

  • Can not click buttons or move windows

    Hi there, I have a strange problem. When I click the mouse in certain areas of the screen or within certain windows it does not have any effect. I can move icons around the screen but windows that are recently opened and which sit towards the left ce

  • MacBook Pro to a projector

    MacBook Pro to a projector which works with an image of the desktop but when I want to play a movie or show photos the projector shows a blank screen. Any one help? Connected via Lightning / HMDI lead.

  • Rename Finder Items from Automator doesn't work correctly!

    I made a rename finder items in Mac OS X 10.4 by just using rename finder items task and save as a plug in for finder. It was working fine. I tried to use it in 10.5, but it doesn't really change the names. I created a new one or even tried to modify

  • N96 dead after failed update

    I got a text/pc suite reminder that new fw was available for the phone. I tried updating using NSU, but it crashed while the screen was showing 15 min remaining. After removing power/battery & reapplying phone doesn't appear to turn on, and "try agai

  • Persistent search using system.directoryservices.protocols

    My goal is to develop an application in VB.NET that monitors eDirectory using an LDAP persistent search. As user objects are added, moved, renamed and deleted in eDirectory, the program will construct an event notification in XML format and send it t