Outer Join not functioning

I have a query as shown below
select w.columns1, w.cloumn2, w.counter
Select a.columns1, a.cloumn2, a.rownum counter
from (subquery a
union
subquery b)
) w
view b
where
w.counter(+) = y.counter,
The view has standard 12 records with a value 0. Now my problem is that for each product_key in main query, if i receive less then 12 records then the oter join with view should halp me to fetch 12 records for a particular product.
But soehow the outer join ins not working.
HELP required ASAP
Thanks in Advance
Ajit

SELECT
w.CA_NUMBER, W.payment_date, y.counter
from
select /*p.portfolio_id, p.ca_number,p.investor_type_code, p.owner_id,
          p.ca_process_date,p.product_month_id,
          p.Transaction_Type,p.payment_date,
          row_number() OVER (PARTITION BY p.ca_number ORDER BY p.ca_process_date) counter
          p.portfolio_id, p.ca_number,p.ca_process_date,p.Transaction_Type,
          row_number() OVER (PARTITION BY p.ca_number ORDER BY p.ca_process_date desc) counter,
          payment_date
from
          -- getting records for both the facility and the fee transaction
          -- select records for the facility transaction
          SELECT x1.portfolio_id, x1.ca_number,x3.investor_type_code, x4.owner_id, x2.ca_process_date,x1.product_month_id,
                    'CA' Transaction_Type,x2.ca_effective_date payment_date
          FROM dls_dm.ca_transaction_fact x,
          dls_dm.ca_product_dimension x1,
          dls_dm.ca_transaction_dimension x2,
          dls_dm.investor_dimension x3,
          dls_dm.owner_dimension x4,
                    dls_rep.adm_acbs_periods x5
          WHERE ( (x1.product_key = x.product_key) )
                    AND (x2.transaction_key = x.transaction_key)
                         AND (x3.investor_key = x.investor_key)
                         AND (x4.owner_key = x.owner_key)
                         AND (x1.product_month_id = 200508)
                         -- to be removed later AND (x1.product_month_id = to_char(x5.Last_processing_date,'yyyymm'))
                         -- and x1.ca_number = '0000000215'
          Union all
          -- select records for the facility transaction
          SELECT x1.portfolio_id, x1.ca_number,x3.investor_type_code, x4.owner_id, x2.process_date,x1.product_month_id,
          'FEE' Transaction_Type, x2.effective_date payment_date
          FROM dls_dm.ca_fee_transaction_fact x,
          dls_dm.ca_product_dimension x1,
          dls_dm.fee_transaction_dimension x2,
          dls_dm.investor_dimension x3,
          dls_dm.owner_dimension x4,
                    dls_rep.adm_acbs_periods x5
          WHERE ( (x1.product_key = x.product_key) )
                    AND (x2.transaction_key = x.transaction_key)
                         AND (x3.investor_key = x.investor_key)
                         AND (x4.owner_key = x.owner_key)
                         AND (x1.product_month_id = 200508)
                         -- to be removed later AND (x1.product_month_id = to_char(x5.Last_processing_date,'yyyymm'))
                         --and x1.ca_number = '0000000215'
     )p
ORDER BY p.ca_number ASC, p.ca_process_date DESC
     )W,
     dls_dm.test_view y
where w.counter(+) = y.counter
and     w.counter <=12
order by 1,3
the code for y starts from here
CREATE OR REPLACE FORCE VIEW DLS_DM.TEST_VIEW
(CA_NUMBER, PAYMENT_DATE, COUNTER)
AS
select CA_NUMBER, payment_date, counter
     from
          select 1 counter, 0 payment_date, '' CA_NUMBER from dual
          union
          select 2 counter, 0 payment_date, '' CA_NUMBER from dual
          union
          select 3 counter, 0 payment_date,'' CA_NUMBER from dual
          union
          select 4 counter, 0 payment_date,'' CA_NUMBER from dual
          union
          select 5 counter, 0 payment_date,'' CA_NUMBER from dual
          union
          select 6 counter, 0 payment_date, '' CA_NUMBER from dual
          union
          select 7 counter, 0 payment_date, '' CA_NUMBER from dual
          union
          select 8 counter, 0 payment_date, '' CA_NUMBER from dual
          union
          select 9 counter, 0 payment_date, '' CA_NUMBER from dual
          union
          select 10 counter, 0 payment_date, '' CA_NUMBER from dual
          union
          select 11 counter, 0 payment_date, '' CA_NUMBER from dual
          union
          select 12 counter, 0 payment_date, '' CA_NUMBER from dual
          ) y;

Similar Messages

  • ORA-30563, Outer Join not allowed in select list

    I can not find any information about this error message that I am getting.
    I have just upgraded my Oracle database from Version 7.3 to Version 8.1.7, a stored procedure that was written in v7.3 has outer joins in the select statement.
    when trying to run this proc in version 8 I get this meesage.(ORA-30563, Outer Join not allowed in select list)
    code ex:
    Select alt.id
    decode(alt.advise, NULL, NULL, AA.act_yr(+))||'-'||AA.act_per(+)||'-'||AA.Acc_per_no(+)) as advise_no
    from alt, AA;
    Is there any information about this message anywhere? or does anybody know if this is a known issue with oracle ver 8.1.7?
    Thanks
    CJ

    It appears to have been a bug in 7.x
    From a metalink note on bugs fixed in 8i (doc 132632.1)
    974742 Oracle does not report an error if (+) is specified in select-list. The OUTER JOIN operator (+) is only valid in WHERE clause predicates. As this is not flagged as an error the query can give unexpected results. The correct action to avoid this problem is to fix the query.
    Ken

  • Dynamic From statement in select query and/or outer join not working

    Dear Experts, I have a select query where the select columns are dynamic, the where condition is also dynamic. It is of the below format:
    Select (dynamic columns) INTO <wa>
    FROM a inner join b on af1 = bf1
    inner join c on af2 = cf2......
    WHERE (dynamic conditios)
    ORDER BY ( dynamic sort condition).
    Now I have to include some tables (dynamically depending on the user input) in the inner join statement which will give description for the selected fields. And these database tables may or may no be empty. So in this case, my select query will not return any data if these tables are empty. And I dont want that.
    I tried using outer join for the extra tables but it gave me a runtime error. I also tried forming the inner join statement dynamically but it was not supporting.
    Kindly give me pointers.
    Thanks

    Hey thanks for the reply, but the problem is not solved.
    I am already using  ( fileds, value) like table in my where condition and the select statement was working properly.
    the problem is that now I have to include some tables in the join statement which can be empty and so i want to use Outer join.
    But I am getting a runtime error as below:
    Error analysis
        An exception occurred that is explained in detail below.
        The exception, which is assigned to class 'CX_SY_DYNAMIC_OSQL_SYNTAX', was not
         caught in
        procedure "ZATSCSNG_RFC_READ_TABLE" "(FUNCTION)", nor was it propagated by a
         RAISING clause.
        Since the caller of the procedure could not have anticipated that the
        exception would occur, the current program is terminated.
        The reason for the exception is:
        The running ABAP program wanted to execute a SELECT statement whose
        WHERE condition was (partly) specified dynamically. The part that is
        specified in an internal table at runtime is compared to a field of the
        right table of an LEFT OUTER JOIN. Such comparisons are not supported by
         all database systems and are therefore not allowed.

  • Left Outer Join Not working in BI 7.0 Infoset

    Hi All,
    I am working on BI 7.0. I have to create a report where I have to display the Target values from a target DSO against the transactional data (Operational data).
    I have a DSO where for a “subteam” value target has been set up on different KPIs.
    In the Info Cube, I have transactional data on daily basis per “subteam”. I have to show the actual and target values.
    I have created an Info Set using Target DSO and Daily operational cube, so that I should able to compare the target and actual values of KPIs, for all the “subteam” values (From DSO, irrespective of whether the data is available in cube for those sub team).
    I have used Outer Left Join in the Info set (DSO on left side), but I am unable to see the desired results. It is working just like an inner join.
    Any Idea why the Outer Left Join is not working? The DSO has only one fey field called “subteam” on which I have set outer left join.
    Regards,
    Amit

    Hi,
    did you solve your problem? because I have the same issue right now: the left outer join doesn't seem to do its job.
    Let me know if you have found a solution, it would be appreciated.
    have a nice day,
    Dominic

  • Left Outer Join not working in Infoset.

    Hello Friends,
    I have two ODSes , one for planned data (zplan) and other is billing z ods (zsd_o03).
    now the situation is such that in my planned ODS  for one sold to party .
    SOLD TO        MATERRIAL CALMONT     PLANNED QUANTIY
    14315            100                06.2007           54
    14315            200                06.2007           20
    14315            300                06.2007           30
    14315            400                06.2007           10
    But in my Billing ODS iam having for Sold to 14315
    SOLD TO        MATERRIAL CALMONT     ACTUAL QUANTIY
    14315           100           06.2007                  20
    14315           200           06.2007                  30
    And my Bex ouput should be like
    SOLD TO        MATERIAL CALMONT        planned             ACTUAL QUANTIY
    14315            100                06.2007           54                                 20
    14315            200                06.2007           20                                30
    14315            300                06.2007           30                                  0
    14315            400                06.2007           10                                0
    So for this i made one Infoset and these ODses are linked by Sold_to , Materail,
    Calmonth.
    First i tried using Inner joing option , but the bottom two lines were not ciming , so used left outer join , and activated and recreated the query but still its showiong me the output same as inner join .. i.e
    14315            100                06.2007           54                                 20
    14315            200                06.2007           20                                30
    So i checked by writing a ABAP code in Se38 , but there its showing me the correct result ..
    So please anybody help me out because iam thinking that infoset is the right way to do this kind of reporting , or esle shall i make one ODS and populate it through this ABAP code..
    Thanks in advance.

    Hi , can anybody help me in this regard..
    Thanks ..

  • Merging two complemental result sets... or OUTER JOINs not working?

    Dear experts!
    Again I have a very difficult problem for which I ask Your help, but this time I am better prepared than last time and can deliver sample data of my (hopefully not too much) simplified example:
    create table Subjects(
    pk_id          number          not null primary key,
    title          varchar2(128)
    create table People(
    pk_id          number          not null primary key,
    name          varchar2(128)
    create table Results(
    pk_id          number          not null primary key,
    fk_subjects_id     number,
    fk_people_id     number,
    result          number
    insert into Subjects(pk_id, title) values (1, 'Choosing a recipe')
    insert into Subjects(pk_id, title) values (2, 'Shopping ingredients')
    insert into Subjects(pk_id, title) values (3, 'Preparations')
    insert into Subjects(pk_id, title) values (4, 'Cooking for beginners')
    insert into Subjects(pk_id, title) values (5, 'Eating for pros')
    insert into Subjects(pk_id, title) values (6, 'Dishwashing for everyone')
    insert into Subjects(pk_id, title) values (7, 'Digesting for experts')
    insert into Subjects(pk_id, title) values (8, 'Becoming hungry again...')
    insert into Subjects(pk_id, title) values (9, 'Redo from start')
    insert into People(pk_id, name) values (1, 'Hank')
    insert into People(pk_id, name) values (2, 'Cloe')
    insert into People(pk_id, name) values (3, 'Mary')
    insert into Results(pk_id, fk_subjects_id, fk_people_id, result) values (1, 1, 1, 2)
    insert into Results(pk_id, fk_subjects_id, fk_people_id, result) values (2, 2, 1, 4)
    insert into Results(pk_id, fk_subjects_id, fk_people_id, result) values (3, 3, 1, 3)
    insert into Results(pk_id, fk_subjects_id, fk_people_id, result) values (4, 9, 1, 5)
    insert into Results(pk_id, fk_subjects_id, fk_people_id, result) values (5, 1, 2, 4)
    insert into Results(pk_id, fk_subjects_id, fk_people_id, result) values (6, 2, 2, 1)
    insert into Results(pk_id, fk_subjects_id, fk_people_id, result) values (7, 3, 2, 5)
    insert into Results(pk_id, fk_subjects_id, fk_people_id, result) values (8, 4, 2, 2)
    insert into Results(pk_id, fk_subjects_id, fk_people_id, result) values (9, 5, 2, 3)
    insert into Results(pk_id, fk_subjects_id, fk_people_id, result) values (10, 6, 2, 2)
    insert into Results(pk_id, fk_subjects_id, fk_people_id, result) values (11, 7, 2, 1)
    insert into Results(pk_id, fk_subjects_id, fk_people_id, result) values (12, 4, 3, 3)
    insert into Results(pk_id, fk_subjects_id, fk_people_id, result) values (13, 5, 3, 5)
    insert into Results(pk_id, fk_subjects_id, fk_people_id, result) values (14, 7, 3, 1)
    insert into Results(pk_id, fk_subjects_id, fk_people_id, result) values (15, 8, 3, 5)
    insert into Results(pk_id, fk_subjects_id, fk_people_id, result) values (16, 9, 3, 1)
    Please imagine this as an university for amateur cooks. Now I want to present them their performance record/"scorecard", for every student, only with her or his marks. On this performance record there should be a list of all 9 subjects possible to pass, and where students got a result, that result should be filled in. I thought that should be possible to achieve with something like this:
    SELECT PEOPLE.NAME, SUBJECTS.TITLE, RESULTS.RESULT FROM RESULTS
    JOIN PEOPLE ON PEOPLE.PK_ID = RESULTS.FK_PEOPLE_ID
    JOIN SUBJECTS ON SUBJECTS.PK_ID = RESULTS.FK_SUBJECTS_ID
    WHERE RESULTS.FK_PEOPLE_ID = 2
    But also using (LEFT|RIGHT|FULL) OUTER JOINs here does not help me to get what I want, I always only get
    NAME TITLE RESULT
    Cloe Choosing a recipe 4
    Cloe Shopping ingredients 1
    Cloe Preparations 5
    Cloe Cooking for beginners 2
    Cloe Eating for pros 3
    Cloe Dishwashing for everyone 2
    Cloe Digesting for experts 1
    But I want:
    NAME TITLE RESULT
    Cloe Choosing a recipe 4
    Cloe Shopping ingredients 1
    Cloe Preparations 5
    Cloe Cooking for beginners 2
    Cloe Eating for pros 3
    Cloe Dishwashing for everyone 2
    Cloe Digesting for experts 1
    Cloe Becoming hungry again...
    Cloe Redo from start
    Without having to fill in empty rows for all students which did not take all exams yet.
    Is it possible? If so, how?
    Thank You very much in advance and Happy Easter to everyone! :-)
    With kind regards,
    Chriss
    Edited by: user9355711 on 01.04.2010 07:01
    Edited by: user9355711 on 01.04.2010 07:28
    Edited by: user9355711 on 01.04.2010 07:29

    Also;
    var n number
    exec :n := 2;
    PL/SQL procedure successfully completed
    n
    2
    select ppl.name, sub.title, res.result
      from subjects sub, people ppl, results res
    where sub.pk_id = res.fk_subjects_id(+)
       and ppl.pk_id = :n
       and res.fk_people_id(+) = :n
    order by sub.title;
    NAME       TITLE                         RESULT
    Cloe       Becoming hungry again... 
    Cloe       Choosing a recipe                  4
    Cloe       Cooking for beginners              2
    Cloe       Digesting for experts              1
    Cloe       Dishwashing for everyone           2
    Cloe       Eating for pros                    3
    Cloe       Preparations                       5
    Cloe       Redo from start          
    Cloe       Shopping ingredients               1

  • Outer join not working

    Hello everybody,
    I have a folder based on materialized view (Detailed folder). There is another folder which is based on a table (master folder). i have created a jooin and select option as "outer join on master folder". The join is not working properly. Am i doing asomething wrong. Discoverer version is 10.1.2 and database version is 10.2.0.3. i have been creating outer joins among folders based on tables but i am not sure about whats wrong this time??? materalized view defination is as follows:
    CREATE MATERIALIZED VIEW MW
    BUILD IMMEDIATE
    REFRESH FORCE
    START WITH SYSDATE
    NEXT TRUNC(SYSDATE+1)+1/4
    WITH PRIMARY KEY
    AS
    SELECT * FROM VIEW
    Thanx for your help
    Regards,
    Najeeb

    So, let me see if I got this...
    You have a table and a materialized view. There is a join between the two, where the table is the master, and the MV is the detail. The join is set to be an outer join on master. Ultimately, you want to see the values in the MV where the join condition is NULL.
    What boggles me is that you say the query runs fine in the database, but not in Disco. This could mean that there is a condition in the BA or in the worksheet. But, if that were the case, the condition should show up in the SQL generated by Disco.
    It looks like the where clause is the problem. NULL is never equal to anything, so when APPROVEDBY is null, the where clause should fail and no data returned. This explains Disco's behavior, but not SQL's.
    Something to try: Create a calculation in the materialized view folder of the business area like:
    NVL(APPROVEDBY, -1)
    I am assuming that all of your IDs are positive. Then modify the join to use the calculated column. This should convert the NULLS to values, and the report should work.

  • Outer join not working when filters are applied from Prompts

    Hi,
    Without values being selected from the dashboard prompts, my outer join is working fine with all the rows and all the columns showing up( as per requirement). But as soon as I select values in the prompts, only certain rows and columns show up.
    BTW, I have 2 prompts Year and Quarter. I put Year is Prompted or is null in the criteria. It works. BUT as soon as I also put in quarter numbers, it does not work.
    Is there a workaround for this?
    Thanks,
    Dan
    Edited by: Danny on Apr 26, 2013 12:10 PM

    I just experimented by adding is null to not only the year and quarter but to the row and column too and it worked!
    Thanks,
    Dan

  • Outer Join or Function

    Hi everyone:
    I would like to know which one is faster: The outer join or the function a select statement.
    Thanks,

    As 3360 pointed out above this question is general enough.
    But in the motto - everything what can be done in plain SQL should be done in SQL:
    SQL> create or replace function my_function(objid in number)
      2  return number
      3  is
      4   obj_type number;
      5  begin
      6   select object_type_id into obj_type from nc_objects where object_id = objid;
      7   return obj_type;
      8  end;
      9  /
    Function created.
    Elapsed: 00:00:00.72
    SQL> set autotrace traceonly stat
    SQL> select (select object_type_id from nc_objects o1 where o1.object_id = o2.object_id) objtype
      2  from nc_objects o2
      3  /
    2092663 rows selected.
    Elapsed: 00:02:154.90
    Statistics
             23  recursive calls
              0  db block gets
        6563019  consistent gets
          23405  physical reads
              0  redo size
       85627517  bytes sent via SQL*Net to client
       15486040  bytes received via SQL*Net from client
         139512  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
        2092663  rows processed
    SQL> select my_function(object_id) from nc_objects;
    2092663 rows selected.
    Elapsed: 00:03:212.10
    Statistics
        2092686  recursive calls
              0  db block gets
        8516178  consistent gets
              0  physical reads
              0  redo size
       85627532  bytes sent via SQL*Net to client
       15486040  bytes received via SQL*Net from client
         139512  SQL*Net roundtrips to/from client
              5  sorts (memory)
              0  sorts (disk)
        2092663  rows processedRgds.

  • Extension manager "install extension" is grayed-out, and not functional

    I paid for the Horizontal Menu Advancer, and downloaded it. This a a Dreamweaver extension. Then I downloaded Adobe Extension Manager CS6.
    From the "File" menu of Extension Manager "Install Extension" is grayed-out, and does not function.

    Hello David
    Please tell us your version of Extension Manager and your version of Dreamweaver, and whether the app is listed in ExMan on the left pane?

  • LEFT OUTER JOIN not working as expected

    I'm testing a query from the portal. I've got two inputs:
    products
    {"ProductKey":1,"ProductAlternateKey":"abc","Color":"Red"},
    {"ProductKey":2,"ProductAlternateKey":"def","Color":"Blue"},
    {"ProductKey":3,"ProductAlternateKey":"ghi","Color":"Blue"}
    And temperatures:
    {"DeviceId":1,"Temperature":99},
    {"DeviceId":2,"Temperature":90},
    {"DeviceId":2,"Temperature":99},
    {"DeviceId":3,"Temperature":50},
    {"DeviceId":4,"Temperature":32}
    When I test a query with an (inner) join, I get two rows, one for Red and one for Blue as expected. However, when I change to a LEFT OUTER JOIN, I would expect to get three rows... one for Red, one for Blue, and one for NULL color. However, I only get one
    row with a NULL color. Here's the query. Is this a bug or am I misunderstanding?
    SELECT DateAdd(second,-5,System.TimeStamp) as WinStartTime
    , system.TimeStamp as WinEndTime
    , b.Color
    , Avg(r.Temperature) as AvgTemperature
    , Count(*) as EventCount
    FROM temperatures r
    LEFT OUTER JOIN products b ON r.DeviceId = b.ProductKey and DATEDIFF(hour,r,b) BETWEEN -6 AND 6
    GROUP BY TumblingWindow(second, 5), b.Color
    (Please excuse the contrived example, the lack of timestamps, and the 12 hour window... just testing.)
    http://artisconsulting.com/Blogs/GregGalloway

    Hi Greg,
    Thank you for raising this issue.
    We have deployed a fix today that corrects LEFT OUTER JOIN behavior on the in-browser query testing experience.
    Can you please confirm that the above query and input sources work for you?
    Thanks!
    Ziv.

  • Query with outer join not dispalying the correct results

    Hi All,
    I am having a table which has a column called status it can either be null or has the code which comes from the lookup b.When I use this query
    select b.menaing from a
    where a.status=b'lookup_code(+)
    AND b.lookup_type='MTH_BUSINESS_FUNCTION'
    AND b.LANGUAGE = USERENV('LANG')
    then I don't get the rows from table a, where status is null
    and if I use the condition:
    select b.menaing from a
    where ((a.status IS NULL) OR
    (a.status=b.lookup_code
    AND b.lookup_type='MTH_BUSINESS_FUNCTION'
    AND b.LANGUAGE = USERENV('LANG') ))
    then I get many extra rows.Can soemone please tell me hwo to achieve this(My query should display the menaing if status column is blank then it should dispaly blank otherwise after joining iwth the lookup table it should display meaning)

    Hi Prazy,
    using nvl also didn't solve my problem.Actually my problem is I am having a table a in which I have a column called satus, status has the values like A or I .I have one lookup called MTH_BUYSINESS_FUNCTION in which for lookup_code A I have menaing as Active and for lookup_code I meaning is Inactive.Now in table a for sttaus I have two values one A and one null Now I want to write sql which displayes the meaning for column staus.Result should be Active and null .If I am uisng 1 query which I gave u I am not able to get the 2nd row in my output.If I use 2nd query then I get duplicate rows.
    Thanks ,
    Amrit

  • Outer join not outer joining

    Hi, I'm trying to do a query like this:
    SELECT A.id, etc
    FROM A,B,C
    WHERE A.id(+) = B.id and A.id = C.id
    GROUP BY A.id
    and this isn't getting the values in B that don't match with A.
    I also tried the ANSI syntax but I got the same result.
    thanks in advance.

    Hi your Join condition of A with C might be the one which is not getting what you want. WHy dont you try only between table A and B and see what you get.
    SELECT A.id, etc
    FROM A,B
    WHERE A.id(+) = B.id
    GROUP BY A.id
    thanks

  • The option to add a hyperlink to a text or image is greyed out and not functional.  How do I fix this?

    The option to add a hyperlink to text or an image in pages is greyed out.  How do I fix this?

    Peter is correct. However, one can clever up two overlayed, grouped Text Box and simulate a hyperlinked image that can be placed in the document body with text flowing around the image. Moving the image requires temporarily turning off the hyperlink in the Link inspector. Example was Pages ’09 v4.3 on OS X 10.8.4.
    Steps:
    From the Pages Toolbar, select Text Box twice. The Text Box will be slightly offset. Select and drag the offset one to just above the centered one.
    Click inside the centered Text Box and back out the placeholder text. Now select this Text Box and choose the graphic inspector.
    Choose Fill > Image Fill. Choose your image, and then Scale to Fit the entire Text Box.
    From the Pages arrange menu, choose Make Background Objects Selectable, and Send Object to Background.
    In the Wrap inspector, select Object Causes Wrap, and your choice there. My example was door #2.
    Click inside your text-only Text Box. Change the placeholder text to three instances of the capital letter ‘O.’
    Launch the Font panel (command+T).
    Manually change the font size to 92 points. This just fits a default Text Box size without wrapping. I used Times New Roman Regular.
    Select the text, and with the Link inspector, enable your choice of hyperlink, and also disable it (for now) with the “Make all hyperlinks inactive.”
    With the text still selected, choose Font color from the Font panel. At the bottom of the Color tool, set the Opacity of your text to zero.
    Drag the transparent text-only Text Box exactly over the top of your image Text Box. Use the blue guides.
    From the Pages edit menu, Select All. From the Pages Arrange menu, choose Group.
    Drag the Text Box group where you want it in your document body. Text will flow around it if you used my setting in the Wrap inspector.
    Lastly, with the Text Box group selected, disable “Make all Hyperlinks inactive” in the Link Inspector. You now effectively have a text map overlaying your image and the mouse pointer changes to a hand. The link is now active. Exporting your Pages document to PDF preserves the hyperlinked image effect in both Preview and Acrobat Reader.

  • Outer Join not giving correct result

    I have two tables=> tab_child_tmp (product_id,region,child_val,mst_product) and
    tab_master_tmp (master_product_id,region,master_val)
    tab_child_tmp.mst_product is the foreign key referencing tab_master_tmp.master_product_id.
    Currently the tables are populated with below values
    tab_child_tmp
    PRODUCT_ID REGION CHILD_VAL MST_PRODUCT
    Arm-01,     CAL,     100,     Arm-Master
    Arm-01,     DEL,     222,     Arm-Master
    Arm-01,     CHEN,     55,     Arm-Master
    Arm-02,     MUM,     69,     Arm-Master
    Arm-02,     DEL,     90,     Arm-Master
    tab_master_tmp
    MST_PRODUCT     REGION     MASTER_VAL
    Arm-Master     , CAL,     390
    Arm-Master     , DEL,     300
    Arm-Master, CHEN,     450
    Arm-Master, MUM,     600
    Now I want to display the result in the below format
    PRODUCT_ID REGION CHILD_VAL MASTER_VAL
    1. Arm-01     , CAL, 100,     390
    2. Arm-01     , DEL, 222,     300
    3. Arm-01     , CHEN, 55,     450
    4. Arm-01     , MUM, 0,     600
    5. Arm-02     , MUM, 69,     600
    6. Arm-02     , DEL, 90,     300
    7. Arm-02     , CHEN, 0,     450
    8. Arm-02     , CAL, 0,     390
    When I am running the below query it is not returning the above 4,7 and 8 rows. Can you please provide the correct sql to get the above desired output
    SELECT
    a.product_id,
    nvl(a.region,b.region) geo,
    nvl(a.child_val,0)match_val,
    b.master_val
    FROM
    tab_child_tmp a,
    tab_master_tmp b
    WHERE
    a.mst_product(+) = b.master_product AND
    a.region(+) = b.region
    Thanks

    Hi
    Thanks for the reply. Please find below the details.
    Oracle Version*
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi
    PL/SQL Release 10.2.0.1.0 - Production
    CORE     10.2.0.1.0     Production
    TNS for Solaris: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    Create Table Script_
    create table TAB_CHILD_TMP
    PRODUCT_ID VARCHAR2(50),
    REGION VARCHAR2(100),
    CHILD_VAL NUMBER,
    MST_PRODUCT VARCHAR2(50)
    create table TAB_MASTER_TMP
    MST_PRODUCT VARCHAR2(50),
    REGION VARCHAR2(100),
    MASTER_VAL NUMBER
    Insert Script_
    INSERT INTO tab_child_tmp VALUES ('Arm-01','CAL',100,'Arm-Master');
    INSERT INTO tab_child_tmp VALUES ('Arm-01','DEL',222,'Arm-Master');
    INSERT INTO tab_child_tmp VALUES ('Arm-01','CHEN',55,'Arm-Master');
    INSERT INTO tab_child_tmp VALUES ('Arm-Master','MUM',69,'PLC1');
    INSERT INTO tab_child_tmp VALUES ('Arm-Master','DEL',90,'PLC1');
    INSERT INTO tab_master_tmp VALUES ('Arm-Master','CAL',390);
    INSERT INTO tab_master_tmp VALUES ('Arm-Master','DEL',300);
    INSERT INTO tab_master_tmp VALUES ('Arm-Master','CHEN',450);
    INSERT INTO tab_master_tmp VALUES ('Arm-Master','MUM',600);
    INSERT INTO tab_master_tmp VALUES ('PLC1','MUM',199);
    INSERT INTO tab_master_tmp VALUES ('PLC1','DEL',299);
    INSERT INTO tab_master_tmp VALUES ('PLC1','CHEN',399);
    Expected output logic*
    Need to display the product value for each region along with the value of master product for the corresponding product and region. If a product doesn't belong to a particular region, but the corresponding master product is, then that value also needs to be displayed for that product and region with child value as zero.
    ie. for product Arm-01 there is no record in tab_child_tmp for region "MUM", but it's master product 'Arm-Master' has a record for region 'MUM' in tab master_tmp table. So in ouput there will be a record for product 'Arm-01' and region-'MUM' with child value as 0 and master value as 600.
    Expected Output*
    PRODUCT_ID ~~~ REG ~~~ CHILD_VAL ~~~ MASTER_VAL
    Arm-01 ~~~ CAL ~~~ 100 ~~~ 390
    Arm-01 ~~~ DEL ~~~ 222 ~~~ 300
    Arm-01 ~~~ CHEN ~~~ 55 ~~~ 450
    Arm-01 ~~~ MUM ~~~ 0 ~~~ 600
    Arm-MASTER ~~~ MUM ~~~ 69 ~~~ 199
    Arm-MASTER ~~~ DEL ~~~ 90 ~~~ 299
    Arm-MASTER ~~~ CHEN ~~~ 0 ~~~ 399
    Please help

Maybe you are looking for