Nested Aggregation Problem

I am using OBI 11g.
Nested aggregation is not supported in some forms in the BI Server (RPD), but appears to be possible by putting the second aggr rule in an Answers column formula or pivot view column. However, I cannot get this to work. Looks like can even be done in the RPD with aggregation based on dimensions, as long as there is a standard aggregation function on the outside of the expression.
The biggest problem with any of the above techniques is the BI Server does not push the outer aggregation rule to the DB engine (the generated SQL).
In my case, consider a Referral Fact with Customer Dim and Referral Dim. I need to get # of Referrals per customer, filter that with a case statement to "bin" 1 Referral and >1 Referral, and then get # of Customers in each bin. So the first measure aggregation looks like:
Other: COUNT (DISTINCT "Referral Key")
Customer: "SUM( CASE WHEN "Referral Key" = 1 THEN 1 ELSE 0 END )"
Or the logical measure just has the COUNT DISTINCT aggregation rule and an Answers column has the CASE statement with a SUM aggregation rule. Or use CASE WHEN "Referral Key" = 1 THEN "Customer Key" END and use COUNT DISTINCT instead of SUM.
All these appear to return correct results, but they all perform the outer aggregation in the BI Server or Pivot engine instead of pushing to the generated SQL (DB engine).
I can't find any problem in the DB Features. We are using SQL Server 2010.
Thanks in advance for help.

Hi AL,
here is my requirement what i have been asked to get this output result.
i have keyfigures KF1, KF2 and total KF.
three characteristics dist,inch,load.
dist-inch-load--KF1-KF2-Total KF                         
  5---A--010-0-----10=10                         
  5---A--120-20----20+10=30                         
10--B---050-0-----50                         
12--C---160-60----60                         
13--D---270-70----70                         
14--E---080-0-----80                         
15--E---120-20----20+80=100                         
15--E---230-30----302080=130     
KF1 is the initial volume coming from the file directily.based on this keyfigure i have to calculate KF2,Total KF.     
In order to calcuate KF2 and Total KF i have some conditions.which are mentioned below;
KF2---> if  load=0 then KF2=0 elseif load>0 then KF2=KF1 ;
Total KF--->if load=0 then Total KF=KF2KF1 elseif load>0 then KF2=KF2KF1
How to achieve this dynamic summation.Do i have to do nested exception aggregation based on the above three characteristics. what would be the open options.please do help me.

Similar Messages

  • OBIEE Error[14041] Nested Aggregation measure are currently not supported

    Hi,
    Please provide workaround for the OBIEE Error[14041] Error in measure definiion. Nested aggregation measures are currently not supported.
    I have two logical columns - Current YTD Invoice Quantity and Prior YTD Invoice Price. I want to create a column which is -
    (Current YTD Invoice Quantity * Prior YTD Invoice Price)/ sum(Current YTD Invoice Quantity * Prior YTD Invoice Price)
    sum in the denominator should be the sum of all rows returned by the report. So level based measures cannot be used as there are multiple report and dimension used may vary.
    Columns Current YTD Invoice Quantity and Prior YTD Invoice Price are already aggregated to Sum.
    If I try to do the sum on the physical column while creating logical column, the query is running for 6-7 hours and not giving any result. Both the columns belong to different alias table in physical layer.
    Please let me know if you guys know any work around for this issue. Also let me know whether this type of nested aggregation are supported in 11g or not?
    Thanks.

    Hi Adil,
    Yes, I did create a hierarchy for the time dimesion.
    No, I was not able to specify the aggregate rule since the source of the logical column is another logical column
    But the time hierarchy works for rows that is not based upon the SUM aggregate at the answers level.
    Say I have 3 columns: Income,Expense, Bottom Line (formula : Income- Expense)
    Income is created based upon a case statement in the Logical Column and
    Expense is also created based upon a case statement in the Logical Column.
    Income 1000 Rupees
    Expense -300 Rupees
    Bottom Line 700 Rupees (where the Bottom line is a row based upon the Answers aggregate formula
    which is SUM(Income+Expense))
    When I add a column year, I get the following output
    Income 2009 500 Rs
    Income 2008 500 Rs
    Expense 2009 -150 Rs
    Expense 2008 -150 Rs
    Bottom Line 2009 700 Rs
    Bottom Line 2008 700 Rs
    The Bottom Line doesn't spread across the Year
    Hope this helps you to understand what my problems is.
    Thank you!

  • Nested aggregation and additional sql in query

    Hi experts,
    I need to create a measure in the rpd that will look like:
    measure 1 = SUM(count distinct (ID)) over(order by T11687.MON_CODE asc rows unbounded preceding)
    Is it possible to have a nested aggregation and the over (...) in the query that willl be generated?
    NB: I can't use the evaluate function
    because measure 1 will be just a factor in a complex calculation where other measures are derived from different tables.
    Regards

    In doesn't work that way.
    this query is a bit "stupid", but try this
    select * from topping where topping_id = 1
    union all
    select * from topping where topping_id = 1
    union all
    select * from topping where topping_id = 1Or better yet, let it return once, and then do
    var = rs.getString(1);
    var2 = var;
    var3 = var;

  • Nested Window Problem

    Hopefully someone out there can help solve this one.
    How do you get a child window to automatically resize within a parent
    window?
    On their own both the child window and the parent window behave as
    expected but once we attempt to load the child window into the parent
    window the child window is sized to some unknown but excessively large
    size.
    Can this be solved with some creative use of parent size relationships
    or do we have to programmatically size the child window?
    Any help/comments/suggestions would be greatly appreciated.
    Sincerely,
    Sean G. Germain

    Glen,
    Thank you for the prompt reply.
    We have already done what you suggested (My explanation was not very
    clear ... sorry) to no avail.
    Any more takers and/or ideas anyone?
    Thanks,
    Sean
    -----Original Message-----
    From: Glen A. Whitbeck [SMTP:[email protected]]
    Sent: Monday, January 26, 1998 2:47 PM
    To: GERMAIN Sean
    Cc: 'Forte Users Group'
    Subject: Re: Nested Window Problem
    You may need to dynamically tell the child window what its parent is (such
    as a named grid that exists on the parent window). Setting the child
    window to size to its parent should work once the child window knows who
    its parent is. You should be able to put your window into that grid at
    specified row and column coordinates. To reset the parent and position a
    widget in a grid, you do something like the following:
    <Widget>.Parent = NIL;
    <Widget>.Row = 1;
    <Widget>.Column = 1;
    <Widget>.Parent = <TargetGrid>;
    I believe that you should be able to do the same thing for a window, too
    (using "Self.Window" instead of "<Widget>").
    Glen
    GERMAIN Sean wrote:
    Hopefully someone out there can help solve this one.
    How do you get a child window to automatically resize within a parent
    window?
    On their own both the child window and the parent window behave as
    expected but once we attempt to load the child window into the parent
    window the child window is sized to some unknown but excessively large
    size.
    Can this be solved with some creative use of parent size relationships
    or do we have to programmatically size the child window?
    Any help/comments/suggestions would be greatly appreciated.
    Sincerely,
    Sean G. Germain<< File: vcard.vcf >>

  • Update Nested Table Problem

    Hi All,
    I have a update problem in nested table.
    Below is my query:
    CREATE OR REPLACE TYPE TRACER.SEARCH_DATA AS TABLE OF VARCHAR2(20);
    UPDATE TRACER_SEARCH_SCHEDULE_LOT_NUM
    SET NOT_FOUND_SOR_LOT_NUM = SEARCH_DATA(
    SELECT
    COLUMN_VALUE
    FROM
    TABLE (SELECT SORTING_LOT_NUMBER FROM TRACER_SEARCH_SCHEDULE_LOT_NUM WHERE JOB_ID = 8)
    WHERE
    TRIM(COLUMN_VALUE) NOT IN (SELECT DISTINCT (SORTING_LOT_NUMBER) FROM SEARCH_SCHEDULE_RESULT_LOT_NUM WHERE JOB_ID = 8)
    ) WHERE JOB_ID = 8;
    ORA-00936: missing expression
    or I try as following
    DECLARE
    sor_lot_num_not_found SEARCH_DATA :=
    SEARCH_DATA
    SELECT
    FROM
    TABLE (SELECT SORTING_LOT_NUMBER FROM TRACER_SEARCH_SCHEDULE_LOT_NUM WHERE JOB_ID = 8)
    WHERE
    TRIM(COLUMN_VALUE) NOT IN (SELECT DISTINCT (SORTING_LOT_NUMBER) FROM SEARCH_SCHEDULE_RESULT_LOT_NUM WHERE JOB_ID = 8)
    BEGIN
    UPDATE TRACER_SEARCH_SCHEDULE_LOT_NUM SET NOT_FOUND_SOR_LOT_NUM = sor_lot_num_not_found WHERE JOB_ID = 8;
    END;
    ORA-06550: line 5, column 9:
    PLS-00103: Encountered the symbol "SELECT" when expecting one of the following:
    ( ) - + case mod new not null others <an identifier>
    table avg count current exists max min prior sql stddev sum
    variance execute multiset the both leading trailing forall
    merge year month DAY_ hour minute second timezone_hour
    timezone_minute timezone_region timezone_abbr time timestamp
    interval date
    <a string literal with character set specificat
    ORA-06550: line 11, column 5:
    PLS-00103: Encountered the symbol ")" when expecting one of the following:
    ; for and or group having intersect minus order start union
    where connect
    ORA-06550: line 14, column 4:
    PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:
    begin case declare end exception exit for goto if loop mod
    null pragma raise return select update while with
    <an identifier> <a double-quoted d
    I have try on the Select Statement, it work. So is it the way that I assign data from nested table and update method is wrong?
    Edited by: skymonster84 on Mar 8, 2011 5:12 PM

    Hi,
    I think MULTISET operators might interest you.
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/operators006.htm
    Not tested :
    UPDATE tracer_search_schedule_lot_num
    SET not_found_sor_lot_num =
          sorting_lot_number
          MULTISET EXCEPT ALL
          CAST(
            MULTISET(
              SELECT distinct sorting_lot_number
              FROM search_schedule_result_lot_num
              WHERE job_id = 8
            AS search_data
    WHERE job_id = 8
    ;

  • Aggregation problem in Qery design

    Hi folks,
    I have the following situation:
    - Characteristics as line items, shown as a hierarchie.
    - KFs and Formulars in columns
    I want the formulars to be calculated on the basis of a combination of two of the characteristics (the bottom two in the lines hierarchy) and then aggregated.
    Exception aggregation allows me to choose "total" based on one characteristic, but not a combination of two.
    One solution would be, of course, to create a new characteristic in the cube that is a combination of the two existing characteristics in question and then use this for exception aggregation. This would be a bit complicated though, as the two characteristics are in fact navigational attributes of characteristics that appear in the data source and the cube.
    Therefore, I'd prefer a solution that is in the scope of query designer rather than cube design.
    Any ideas?
    PS: The formulars show correct values on the level of the bottom most characteristic in the lines hierarchy if I choose that characteristic for exception aggregation. The results are not correct one level up from there as I can not get the system to sum the results up along the hierarchy. Instead, they are calculated for the aggregated values of the KFs used in the formular.
    Apparently the "show lines as hierarchy" function really only affects display of the lines, not calculations.

    Hi John,
    I understood your problem. Solution is easy:
    Make formula 1, exception aggregation as total , ref char as char 1
    Then make another formula 2 on formula 1, exception aggregation as total , ref char as char 2.
    And in the report show formula 2 and hide formula 1.
    Best Wishes,
    Mayank

  • CostCenter Group Aggregation problem. High Priority Issue.

    Hi Experts,
    I have very crital issue in the report, Help needed.
       I had some kind of requirement in one of the Overhead cost report, need to combine the COPA data and Costcenter(Over Head cost) data.  I have a problem with Costcenter Group aggregation on the report.
    I have Restricted 2-Keyfigures  want to derive the 3rd Keyfigure values. I given the below exmaple of the data. In my report I just want to display the KeyFigure(KF-A,B,C). I dont want to Display the Cost Center group/Costcenter Number in my report. My report ouput will be one line. But If I removed the costcenter Group I am seeing different values of the Keyfigure C, If I display the Costcenter comng with differnt Values. I am expecting the values in the column C is 1400 but it is coming like 3600.
    Please guide me how to design the Keyfigures if I want to get the value 1400 in theKeyFigre C with out Showing the Costcenter In the report.
    Cost-Center Group  R00048                         
                      Costcenter     KF-A     KF-B           KF-C
         10113     10     10          100
         10114     20     20          400
         10115     30     30          900
              60     60          1400(Insted of this its comming like 3600)
    Appreciate the response.
    Thanks,
    Venkata

    Hi,
    Check the display properties of key figure in Query Designer/Info object level.
    Set the property accordingly.
    I hope it will help.
    Thanks,
    S

  • SQL: Aggregating Problem

    Hello,
    i have following problem with aggregating values with one of our tables:
    For each day there is a row which contains the change to the previous day.We need now a view containing for each date of the year a subtotal from the beginning of the year . Is there any aggregating function with this functionality? Is it possible to solve this without using PL/SQL?
    Example:
    create table example (datum date, diff number);
    Rows in the table:
    insert into example (to_date('01-01-2005','dd-mm-yyyy'), -1);
    insert into example (to_date('02-01-2005','dd-mm-yyyy'),1);
    insert into example (to_date('03-01-2005','dd-mm-yyyy'),2);
    insert into example (to_date('04-01-2005','dd-mm-yyyy'), -1);
    We need following result:
    '01-01-2005', -1 --(sum from 01-01-2005 to 01-01-2005)
    '02-01-2005', 0 --(sum from 01-01-2005 to 02-01-2005)
    '03-01-2005', 2 --(sum from 01-01-2005 to 03-01-2005)
    '04-01-2005', 1 --(sum from 01-01-2005 to 04-01-2005)
    Thanks for your help
    Philipp
    Message was edited by:
    [email protected]

    The windowing clause may not be required, but depending on how the O/P feelas about multiple months, or years, something like this may be more accurate.
    DATUM             DIFF
    01-JAN-2005         -1
    02-JAN-2005          1
    03-JAN-2005          2
    04-JAN-2005         -1
    29-DEC-2004          1
    30-DEC-2004          2
    31-DEC-2004          3
    SQL> SELECT datum, SUM (diff) OVER (ORDER BY datum) diff
      2    FROM example;
    DATUM             DIFF
    29-DEC-2004          1
    30-DEC-2004          3
    31-DEC-2004          6
    01-JAN-2005          5
    02-JAN-2005          6
    03-JAN-2005          8
    04-JAN-2005          7
    SQL> SELECT datum, SUM (diff) OVER (PARTITION BY TRUNC(datum,'YEAR')
      2                                 ORDER BY datum) diff
      3  FROM example;
    DATUM             DIFF
    29-DEC-2004          1
    30-DEC-2004          3
    31-DEC-2004          6
    01-JAN-2005         -1
    02-JAN-2005          0
    03-JAN-2005          2
    04-JAN-2005          1John

  • OLAPTRAIN - Measure Aggregation Problem

    Hi all,
    i've a great problem and i ask your help.
    I've installed OLAPTRAIN schema and I've correctly generated repository file thru AWM plugin.
    Once uploaded repository i've tried to make analysis with BIEE.
    I've choosen Region as dimesion and Sell as misure but here i've the problem.
    Here is an example of result:
    Region Sell
    Africa
    123
    456
    789
    123
    Europe 565
    575
    342
    As you can see, Region is correct but Sell is not aggregated correcly while in AWM data are all correct.
    I've also tried to chose only dimension and they are correct.
    Example:
    Region Product Channel
    Europe Computer Direct
    Camera Direct
    Indirect
    So i think the problem is with Sales table facts.
    Could you help me to find the problem?
    Aplication Versions:
    oracle BIEE 11.1.1.5.0
    Administration TOOLS 11.1.1.5.0
    AWM patch 11.2.0.2.0B
    Thank you all very much in advance.

    It could be a problem with versions compatibility?
    Edited by: 896514 on 15-nov-2011 15.59

  • Aggregator Problems

    I have three swfs/projects that are daisy chained and also put into the aggregator. The aggregated file is here.
    When it gets to the end of one swf and starts the next, instead of showing the next swf correctly, it plays the audio only for a few seconds while showing a white screen and then stalls out. At that point, the controls for the movie no longer work. It looks like this when it stalls:
    This behavior is the same whether the files/projects are daisy chained or not. It also did it when I used a button to launch the next file.
    If I refresh the browser when it is stuck, it starts working again, but the TOC controls no longer work. You can click on a TOC entry and nothing happens.
    I routinely clear the browser and flash caches when I test.
    I am struggling to get the project titles to save correctly, have tried most of the save as tricks suggested here. Don't know if that is part of the problem, but suspect it is not, because the file starts playing again correctly when refreshed. Also deleted the Adobe Captivate Course Companion widget in the swf that stalls out (the only plugin), but that didn't help.
    Been working all day on this one, would love some fresh ideas. Thank you!

    When publishing projects that will be aggregated, don't try to daisy chain them. Aggregator will look after that.  Just set the Project End option in Preferences to Stop Project.  After each SWF is aggregated, as soon as one project finishes playing, the next one will start.
    Another tip I find useful: Don't have any objects on the very first slide in each SWF.  Just make it blank and about 1 second long.  Start your animation or audio etc on the second or third slide in the movie.  If you want a fade-in effect, use the first blank slide as a fade in slide via the Project Start option, not the slide's own fade-in transition.  The project fade in seems cleaner to me.

  • Nested subcontrollers problem

    Hi,
    I have an application with one main controller and some nested subcontrollers.
    On the main page I have <bsp:call> to subcontroler 1, and on the page controlled by subcontroller 1 I have another <bsp:call> to subcontroller 2.
    The problem is that when I trigger an event on the page controlled by subcontroller 2 the request is not catched by the do_handle_event of subcontroller 2.
    I have dispatch_input() in do_request of main controller and nowhere else.
    My application is stateful.
    Does anyone know how to build application with nested controllers

    You <b>need not</b> to have dispatch_input() in all the subcontroller..
    In Main Controllers DO_INIT() method: You need to attach the subcontroller:
    sub_cont1 ?=
      create_controller( controller_name = 'list.do'
                         controller_id   = 'List' ). 
    sub_cont2 ?=
      create_controller( controller_name = 'control.do'
                         controller_id   = 'Detail_Long_Id' ).
    Look at the SAP standard BSP Application <b>BSP_MODEL</b>. You will get the clear idea..
    Raja T

  • Nested Repeater Problem

    Hi All,
    I have a nested Repeater structure (please see attached
    code). There is an outer Repeater which contains a VBox with
    another inner Repeater inside that. I add items one at a time to
    the Repeaters to create a tree like structure that should look
    like:
    Outer0
    Inner0
    Inner1
    Outer1
    Inner0
    Inner1
    If the outer Repeater is set with recycleChildren="true"
    then the inner Repeater data is shown incorrectly, specifically it
    looks like:
    Outer0
    Inner0
    Inner0 (Should be Inner1)
    Outer1
    Inner0
    Inner1
    If the VBox between the outer and inner Repeaters is removed
    then the Repeaters work correctly.
    I believe there is a problem here in that when a Repeater
    recycles it's components it checks to see if each component is also
    a [nested] Repeater and if so it executes that Repeater. However,
    if the nested/inner Repeater is not a direct descendent of the
    outer Repeater (ie. in this example there is a VBox between the
    inner and outer Repeaters) then any [grand]child Repeaters are not
    executed.
    Has anyone else come across this? Am I doing something wrong
    and/or is there a workaround? I may be able to fix it if I can
    force the Repeater to execute, but unfortunately the execute method
    is private.
    Incidentally, I do not want to set recycleChildren to false
    as this causes a flicker, and I need the VBox inbetween for layout
    purposes.
    Thanks a lot,
    Chris.
    ----

    Hi Chris,
    I was excited when I see your question because I am having the same issue now, but I was turned down when there is no reply to your questions. Do you happen to solve this issue after all? Your feedback will be appreciated! Thanks in advance!

  • BPMN to BPEL nested XOR problem

    Hi everyone
    I'm having a problem when converting BPMN to BPEL. In my BPMN diagram i have various XORs that validate the output of a predecessing process. If the values are not correct, they terminate the process with an error message, otherwise the main sequence continues. The problem is, when i convert my diagram to BPEL, the generated Switches nest in an unorderly manner. I can't find a way to delimit where the scope of one swith ends, so instead of having one switch after another, they nest.
    Normally when you perform branching with XOR gateways, there is a point where you join them with another XOR gateway. But in my diagram's case, that is not possible since one of the branches terminates the process with an end event and there is no way of linking the end event with the joining XOR gateway.
    Does anyone know how to solve this? I would appreciate any help

    Hi,
    sorry for the late reply.
    If I understood you right you have the following issue:
    Start Event -> XOR(Branch A | Branch B with Error-End-Event) -> New XOR(...) -> End
    What you should try is to add a JOIN-XOR after the first Switch. This will result in two independent Switches (one after the other) - even if the Error-End-Event is not connected to the joining XOR.
    Start Event -> XOR(Branch A | Branch B with Error-End-Event) -> JOIN XOR -> New XOR(...) -> End
    Best regards, Danilo

  • Ragged Hierarchy - aggregation problem

    I build dimension with Ragged Hierarchy as posted in [|http://oracleolap.blogspot.com/2008/01/olap-workshop-4-managing-different.html]
    in "*Skip, Ragged and Ragged-Skip Level Hiearchies*" section.
    I use scott schema for test
    _1- build dimension emp with 4 levels using this data_
    ==> these data come from relation between EMPNO and MGR columns of EMP table
    LVL1_CODE, LVL1_DESC, LVL2_CODE, LVL2_DESC, LVL3_CODE, LVL3_DESC, LVL4_CODE, LVL4_DESC
    7839, KING                              
    7839, KING     , 7566, JONES                    
    7839, KING, 7566, JONES, 7788, SCOTT          
    7839, KING, 7566, JONES, 7788, SCOTT, 7876, ADAMS
    7839, KING, 7566, JONES, 7902, FORD          
    7839, KING     , 7566, JONES, 7902, FORD, 7369, SMITH
    7839, KING     , 7698, BLAKE               
    7839, KING     , 7698, BLAKE, 7499, ALLEN          
    7839, KING     , 7698, BLAKE, 7521, WARD          
    7839, KING     , 7698, BLAKE, 7654, MARTIN          
    7839, KING     , 7698, BLAKE, 7844, TURNER          
    7839, KING     , 7698, BLAKE, 7900, JAMES          
    7839, KING     , 7782, CLARK               
    7839, KING     , 7782, CLARK, 7934 MILLER          
    _2- build cube salary cube using this data_
    EMPNO     SAL
    7369     800
    7499     1600
    7521     1250
    7566     2975
    7654     1250
    7698     2850
    7782     2450
    7788     3000
    7839     5000
    7844     1500
    7876     1100
    7900     950
    7902     3000
    7934     1300
    The total sum of salary on the top of hierarchy "KING" is 9,750$ and the correct value must be 29,025$.
    I Notice that, in any node in hierachy that has childern the value of salary sum is the summation of its chiildern only without its value.
    so what is the problem??

    EMPNO SAL
    7369 800
    7499 1600
    7521 1250
    7566 2975
    7654 1250
    7698 2850
    7782 2450
    7788 3000
    7839 5000
    7844 1500
    7876 1100
    7900 950
    7902 3000
    7934 1300I can see the above data and looks like you are loading some values at higher level i.e. for emp no 7566. In DWH you will be loading data at leaf level and OLAP engine does aggregation(solve) and store data at higher level. What you are seeing is correct as any node's value is equal to the sum of values of its children.
    Thanks,
    Brijesh

  • Stored procedure: nested cursor problem

    Hey folks,
    i am really having a hard time trying to figure out how nested cursors work.
    What i want to do:
    -> Do one select statement and process the yielded rows with one cursor
    -> Do another select statement depending on the first cursor
    The code is quite simple, the beginning of the stored procedure is:
    create or replace
    PROCEDURE extractEntireMD IS
    CURSOR curTemplateUnitId IS
    SELECT
    tu.externalident,
    tu.templateunitid
    FROM
    templateunit tu
    WHERE
    tu.templateunitid = 100007;
    CURSOR curPartTypeId(templateUnitID IN varchar2) IS
    SELECT
    tpt.parttypeid
    FROM
    templateparttype tpt
    WHERE
    tpt.templateunitid = templateUnitID;
    From what i have read, this seems to be right.
    No i want to use this code like this:
    BEGIN
    FOR valInCurTemplateUnitId IN curTemplateUnitId LOOP
    DBMS_OUTPUT.PUT_LINE('ExtIdent: ' || valInCurTemplateUnitId.externalident);
    DBMS_OUTPUT.PUT_LINE('templateunitid: ' || valInCurTemplateUnitId.templateunitid);
    FOR valIncurPartTypeId IN curPartTypeId(valInCurTemplateUnitId.templateunitid) LOOP
    DBMS_OUTPUT.PUT_LINE('PartTypeId: ' || valIncurPartTypeId.parttypeid);
    END LOOP;
    END LOOP;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    DBMS_OUTPUT.PUT_LINE('No such data ');
    END;
    The problem:
    I seem to be doing something wrong, because Oracle does not heed the argument which i give to the second cursor from the first cursor:
    CURSOR curPartTypeId(templateUnitID IN varchar2) IS
    which i call via:
    FOR valIncurPartTypeId IN curPartTypeId(valInCurTemplateUnitId.templateunitid)
    Instead, oracle prints out __all__ templateunitids.
    If I modify the second cursor with a constant argument like this:
    CURSOR curPartTypeId(templateUnitID IN varchar2) IS
    SELECT DISTINCT
    tpt.parttypeid
    FROM
    templateparttype tpt
    WHERE
    tpt.templateunitid = 100007;
    The result is correct. So it seems like oracle simply disregards the parameter i am giving him for the second cursor.
    What am i doing wrong?

    > i am really having a hard time trying to figure out how nested cursors work.
    Good. I trust that this will result in the realisation that it is an idiotic thing to emulate the features of the SQL engine in PL/SQL. Only a fool thinks the he/she can outprogram and outsmart the SQL engine, and do things like nested loop joins better and faster in PL/SQL.
    Use SQL for the purpose it was designed. Use PL/SQL for the purpose it was designed.
    Joining of data? That is prime function and feature of SQL. Not PL/SQL.

Maybe you are looking for

  • How to hide a view in BDT

    Dear Experts, I have a screen and there is a tab which I would like to hide on the screen. I found out which view it isin BDT. But now I would like to hide the view, Can you please let me know how should I hide it so that it is not visible on the scr

  • Read the first word of each line in a text file

    i need to read the first word of each line of a text file. i know of line.split() but not actually sure how i would go about using it Any help most appreciated Many Thanks Ben

  • MAC POWER POINT TO CAPTIVATE

    WHEN I TRY TO BEGIN A CAPTIVATE PROJECT FROM AN IMPORTED POWER POINT ON MY MAC ONLY THE LEFT HALF OF THE SLIDE IMPORTS.  I HAVE TRIED DIFFERENT SIZES OF FILES TO SAVE BUT IT DOESN'T MAKE A DIFFERENCE WHETHER I USE THE ORIGINAL POWER POINT SIZE OR THE

  • Very VEry urgent

    Hi All, Hi Experts ,        I am asking a basic question but not able to rectify from last one day itself. Please Do the need ful. Data : S_TRAN type mesg-erfmg. user input   s_tran  from 2 to 3 in my internal table i_output-erfmg contain value like 

  • Deploying Jdeveloper 10g project on unix

    We are trying to deploy a Servlet based application on Unix. the project follows the mvc architecture and uses Property files. The project has been thoroughly tested in the windows environment. However on deploying to a unix environment. Resource Bun