Problem with outer join with filter on join column

Hi,
In physical layer I have one dimension and two facts, and there's an outer join between the facts.
dim_DATE ,
fact_1 ,
fact_2
Joins:
dim_DATE inner join fact_1 on dim_DATE.DATE = fact_1.DATE
fact_1 left outer join fact_2 on fact_1.DATE = fact_2.DATE and fact_1.SOME_ID = fact_2.SOME_ID
When I run a report with a date as a filter, OBIEE executes "optimized" physical SQL:
select fact1.X, fact2.Y
from
Fact_1 left outer join on fact_1.DATE = fact_2.DATE and fact_1.SOME_ID = fact_2.SOME_ID
where Fact_1.DATE = TO_DATE('2009-05-28' , 'YYYY-MM-DD' )
and  Fact_2.DATE = TO_DATE('2009-05-28' , 'YYYY-MM-DD')
The filter on Fact_2.DATE effectively replaces outer join with inner.
Is there a way to disable this "optimization", which is actually very good for inner joins, but doesn't allow outer joins?
Thanks in advance,
Alex
Edited by: AM_1 on Aug 11, 2009 8:20 AM

If you want to perform a Fact-based partitioning with OBIEE (two fact with the same dimension), you have to :
* create in your physical layer for each fact table the joins with the dimension
* create in the Business Model layer ONE star schema with ONE logical fact table containing the columns of your two physical fact table
In this way when you choose minimal one column of your fact1 and one column of your fact2, OBIEE will perform two query against each fact table/dimension, join them with an OUTER JOIN and your problem will disappear.
Cheers
Nico

Similar Messages

  • GR with out PO with m.type 501

    Dear all,
    we are doing GR with out po (others) with m.type 501 we are getting the below error
    Account determination for entry 1000 GBB ____ ZOB 1000 not possible
    i will do the automatic account dtermination for this ,
    could any one expalin me
    1)whts is ZOB and purpose of ZOB
    2) whta is the process after GR with out PO (like we will di IR after GR w.r.t PO)
    Points will be rewarded
    regards
    venu gopal

    Dear all,
    can any one suggest me the Process of GR without PO with movement type 501
    what is the process after creating GR to Vendor payment andthe different account it will hit .
    i am trying to simulate it in test system at the time GR it is hitting GBB-ZOB (PK 91) is getting credited and stock account is (BSX) is debited.
    Regards
    venu gopal

  • MRP Runs With Out Forcasting & With Miximum Level.

    Hi  All,
    I Have a One Finished goods Item Which is Marked as Inventory Item and Sales Item.
    My Inventory Management is Werehouse Level
    So This Item I have a In Stock Quantity is 40 at my werehouse Minimum Quantity is 50  and Maximum Quantity is 400 Both
    of  this minimum and Maximum Quantity will Put Manuly by me at Item Master.
    I Don't wnat to Use the Forcasting For Any Item.
    I Want to Run MRP For This Item at  Maximum Level
    If Item Goes down to minimum Inventory Level for Example: In stock Is 40 at that time I wnat to Run MRP 
    My Requirment is when I run MRP System Gives Recomandation to me a 360 Quantity
    Meanse  { Maximum Quentity-Instock=Recomandatin  } [ 400-40=360]
    Is It Possibal or any one have solution for this Requirment then Pl z send it to me.
    Vikas

    Hello Vikas - I doubt also that you will find an MRP system with that, however, here is something you might want to fool around with as a start to creating an alert message or daily SQL run...
    SELECT
    T0.[ItemCode],
    T0.[MinLevel],
    T0.[MaxLevel],
    T0.[OnHand],
    T0.[MaxLevel]-T0.[OnHand] AS 'Sugg Order'
    FROM OITM T0
    WHERE
    T0.[OnHand] <=  T0.[MinLevel]
    AND  T0.[MinLevel] <> 0
    At least this will give you a list of products you can look at until you can find something else.
    Maybe this will help?  I hope so...
    Regards - Zal

  • GR with out PO with m.type 501 (std Process)

    Dear all,
    can any one suggest me the Process of GR without PO with movement type 501
    what is the process after creating GR to Vendor payment andthe different account it will hit .
    i am trying to simulate it in test system at the time GR it is hitting GBB-ZOB (PK 91) is getting credited and stock account is (BSX) is debited.
    Regards
    venu gopal
    Edited by: venu kk on May 29, 2008 2:53 PM

    Hi,
    Accounts for GRN without PO is as follows
    Inventory Account ( BSX) -Debit
    GR/IR - Credit (GBB-ZOB) . It hits the account u have assigned to Valuation Class-GBB-ZOB in OBYC. Please check wich account u assigned in OBYC . (Normally GR/IR accout).
    Regards
    Vinod

  • Tabular form from query with outer join destroys the universe!

    Well, maybe just my app...
    At any rate, what I have is a query that pulls RISKS for a project and does a reasonable outer join which joins the latest value from a RISK_HISTORY table. Values for RISK are updated and the value for RISK_HISTORY is changed and a new entry added to the RISK_HISTORY table.
    At least that's how it's supposed to be.
    I was able to do this with a report-with-a-form region by adding an extra update process to do a new insert into RISK_HISTORY but it seems that the tabular form is a bit more work.
    Here's the query I'm using:
    select * from(
    select
    r.RISK_SEQ RISK_SEQ_DISPLAY,
    r.RISK_PRIORITY,
    r.RISK_INFO,
    r.RISK_MITIGATION,
    r.ONGOING_FLAG,
    r.RISK_DATE,
    r.WEEK_GROUP_SEQ,
    r.CREATED_ON,
    r.CREATED_BY,
    r.LAST_MODIFIED_ON,
    r.LAST_MODIFIED_BY,
    rh.STATUS,
    row_number() over (partition by rh.risk_seq order by rh.last_modified_on desc) rn
    from RISK r, WEEK_GROUP w, RISK_HISTORY rh
    where w.PROJECT_SEQ=43
    and r.week_group_seq= w.week_group_seq
    and w.week_index=0
    and rh.RISK_SEQ = r.RISK_SEQ
    ) where rn = 1
    Clicking "Add Row" gets me this:
    Error in mru internal routine: ORA-20001: no data found in tabular form
    Running debug doesn't seem to expose much for me either. Is there a better tact for me to take here?
    Thanks,
    Jon

    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

  • Help with outer joins in Oracle!!

    so far this is what i've come up with and the code below does not work. Can anyone please help me on how the sytanx of left joins and how to use multiple left joins in a single query in oracle?
    SELECT a.*, b.Position_CD, c.Skill_CD, d.Team_Name, d.Team_Country, d.Club, e.Structure_Name
    FROM Roster a, Roster_position b, roster_skill c, Team d, Team_Structure e
    where (a.Roster_ID = ((b.Roster_ID= c.Roster_Id(+)) b.roster_id(+)).......
    I dont' know how to add more left joins!
    Here is the query I'm trying to duplicate (which is a query from Ms Access databaase which works fine).
    SELECT a.*, b.Position_CD, c.Skill_CD, d.Team_Name, d.Team_Country, d.Club, e.Structure_Name
    from ((Roster a LEFT JOIN (Roster_Position b LEFT JOIN Roster_Skill c ON b.Roster_ID=c.Roster_ID) ON a.Roster_ID=b.Roster_ID) LEFT JOIN Team d ON a.Team_CD=d.Team_CD) LEFT JOIN Team_Structure e ON a.Team_Structure_CD=e.Team_Structure_CD
    ORDER BY a.Roster_Id;
    Any help or comments are greatly appreciated

    First,
    I am not one of the leading SQL brains here...but I'm taking a stab, nonetheless.
    Second,
    Here's my best guess - and it seems to me that it should work as there are not two outer joins between any two tables. I hope I decoded your joins correctly - quite a mess that Access syntax!
    SELECT a.*, b.position_cd, c.skill_cd, d.team_name, d.team_country, d.club, e.structure_name
    FROM ROSTER a, ROSTER_POSITION b, ROSTER_SKILL c, TEAM d, TEAM_STRUCTURE e
    WHERE a.roster_id = b.roster_id(+)
    AND b.roster_id = c.roster_id(+)
    AND a.team_cd = d.team_cd(+)
    AND a.team_structure = e.team_structure(+);Third,
    As an architect-dude, it seems to me that you have a serious
    modeling problem to need so many outer joins in such a basic
    grab of data. In any scale other than minute, the performance
    of this model will suffer dramatically. Specifically, why can't
    ROSTER have an equijoin with TEAM and with TEAM_STRUCTURE - as they
    appear to be lookup tables...
    Good Luck
    (I'm certain you'll get better SQL from the others),
    Michael O'Neill
    Publisher of the PigiWiki
    clever-idea.com

  • Group by with outer join

    Group by sum doesn't work with outer join. Can anyone please help me to get it right?
    I've posted some sample data and queries below:
    CREATE TABLE COMPLAINT
      CNO     NUMBER,
      REASON  VARCHAR2(15 BYTE),
      TOTAL   NUMBER
    Insert into COMPLAINT
       (CNO, REASON, TOTAL)
    Values
       (1, 'edge', 250);
    Insert into COMPLAINT
       (CNO, REASON, TOTAL)
    Values
       (2, 'edge', 250);
    Insert into COMPLAINT
       (CNO, REASON, TOTAL)
    Values
       (3, 'brst', 300);
    Insert into COMPLAINT
       (CNO, REASON, TOTAL)
    Values
       (4, 'crea', 400);
    COMMIT;
    CREATE TABLE SCOTT.COMPLAINTROLL
      CNO   NUMBER,
      ROLL  VARCHAR2(15 BYTE)
    SET DEFINE OFF;
    Insert into COMPLAINTROLL
       (CNO, ROLL)
    Values
       (2, 'roll22');
    Insert into COMPLAINTROLL
       (CNO, ROLL)
    Values
       (1, 'roll4');
    Insert into COMPLAINTROLL
       (CNO, ROLL)
    Values
       (1, 'roll3');
    Insert into COMPLAINTROLL
       (CNO, ROLL)
    Values
       (1, 'roll2');
    Insert into COMPLAINTROLL
       (CNO, ROLL)
    Values
       (1, 'roll1');
    COMMIT;
    select * from complaint
    CNO     REASON     TOTAL
    1     edge     250
    2     edge     250
    3     brst     300
    4     crea     400
    select * from complaintroll
    CNO     ROLL
    1     roll1
    1     roll2
    1     roll3
    1     roll4
    2     roll22
    -- total of reason code edge is 500
    select reason,sum(total)
    from complaint c
    group by reason
    REASON     SUM(TOTAL)
    brst     300
    crea     400
    edge     500
    -- total of reason code edge after outer join is 1250
    select reason,sum(total)
    from complaint c,complaintroll cr
    where c.cno=cr.cno(+)
    group by reason
    REASON     SUM(TOTAL)
    brst     300
    crea     400
    edge     1250
    {\code}
    Thanks for reading this post.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    The problem that you described is simple. The outer join duplicates all the rows from the parent table (complaint). If you want to sum a column from the parent table, then this sum includes all the duplicated rows.
    There are several solutions for this problem.
    A) One had been shown already by Cenutil. Instead of doing an outer join, you can do a subquery in the select clause that delivers the additional information from the detail table.
    SQL> select reason,
       sum(total),
       sum((select count(*) from complaintroll cr where c.cno=cr.cno)) cnt_rolls
    from complaint c
    group by c.reason;
    REASON          SUM(TOTAL)  CNT_ROLLS
    crea                   400          0
    brst                   300          0
    edge                   500          5b) sum in two steps. First sum and count including the join criteria, then use this information to calculate the correct total sum.
    SQL> select reason, sum(stotal), sum(stotal/scount), sum(scount), sum(cnt_rolls)
      2  from (select reason, sum(total) stotal, count(*) scount, count(cr.cno) cnt_rolls
      3         from complaint c
      4         left join complaintroll cr on c.cno=cr.cno
      5         group by reason, c.cno
      6         )
      7   group by reason;
    REASON          SUM(STOTAL) SUM(STOTAL/SCOUNT) SUM(SCOUNT) SUM(CNT_ROLLS)
    crea                    400                400           1              0
    brst                    300                300           1              0
    edge                   1250                500           5              5
    sql> c) another option is to do the left join, but do the aggregation only one time for the parent table. Analytic functions are helpful for that. However since analytic fuinctions can't be used inside an aggregation function, we would again need an inline view.
    SQL> select reason, sum(case when rn = 1 then total end) sum_total, count(*), count(crcno)
      2  from (select row_number() over (partition by c.reason order by c.cno) rn,
      3                   c.*, cr.cno crcno
      4         from complaint c
      5         left join complaintroll cr on c.cno=cr.cno
      6         )
      7  group by reason;
    REASON           SUM_TOTAL   COUNT(*) COUNT(CRCNO)
    brst                   300          1            0
    crea                   400          1            0
    edge                   250          5            5
    SQL> Edited by: Sven W. on Feb 10, 2011 1:00 PM - formatting + column added to 2nd option

  • Outer join with NVL function

    Hello
    I am trying to translate the following Sybase Query to Oracle . I am running the query on a 10gR1 database.
    The problem is with the NVL clause on the join I am getting a runtime exception .
    Is there a way to re-write this query without breaking the functionality.
    SELECT t1.*,
    NVL(t2.Branch_name, t3.Branch_name)
    FROM table1 t1
    LEFT OUTER JOIN
    table2 t2
    ON (t1.Account_id = t2.Account_id)
    LEFT OUTER JOIN
    table3 t3
    ON (t1.Account_id = t3.Account_id)
    LEFT OUTER JOIN
    table4 t4
    ON (NVL(t2.Branch_Name, t3.Branch_Name) = t4.cost_centre);
    Thanks

    The original query had a insert statement and it was failing with ORA-01400 even though the select query fetched 0 rows
    Insert into Branch_Master
    SELECT t1.*,
    NVL(t2.Branch_name, t3.Branch_name)
    FROM table1 t1
    LEFT OUTER JOIN
    table2 t2
    ON (t1.Account_id = t2.Account_id)
    LEFT OUTER JOIN
    table3 t3
    ON (t1.Account_id = t3.Account_id)
    LEFT OUTER JOIN
    table4 t4
    ON (NVL(t2.Branch_Name, t3.Branch_Name) = t4.cost_centre);
    ksedmp: internal or fatal error
    ORA-01400: cannot insert NULL into ("<<schema_name>>"."Branch_Master"."BRANCH_NAME")
    I have re-written the query using a Inline view . Can you please review and let me know if it is ok
    select * from
    ( SELECT t1.*,
    NVL(t2.Branch_name, t3.Branch_name) Branch_name_final
    FROM table1 t1
    LEFT OUTER JOIN
    table2 t2
    ON (t1.Account_id = t2.Account_id)
    LEFT OUTER JOIN
    table3 t3
    ON (t1.Account_id = t3.Account_id) ) IV_Temp
    LEFT OUTER JOIN Table4 on (IV_temp.Branch_name_final = T4.cost_centre ;

  • Outer Join with an 'OR'

    I have a very complicated query to construct that requires the use of 'AND', 'OR', and Outer Joins. Oracle's 9i documentation says you can't use an outer join with an 'OR'.
    Can you suggest how I may return the correct records under the following conditions. There are 3 tables to join. Table A, Table B, and Table C. Tables A & B join with an = to common fields. The problem is with Table C.
    The way the application was designed, it has to track a parent and child relationship. As such, the field to relate may exist in 1 of 2 fields. Let's see if I can draw it out for you.
    Table A - Record 1
    (ID = 1)
    Table B - Record 1
    (ID =1 [this relates to Table A.ID]
    PID = 12345
    CID = 67899
    Site = A)
    Table C - Record 1
    (PID = 12345 [this relates to Table B.PID]
    CID = 67899
    Site = A)
    Table C - Record 2
    (PID = 67899 [This relates to Table B.CID]
    CID = 12345
    Site = A)
    Now, I need to relate Table A to Table B where A.ID = B.ID AND
    ((B.PID = C.PID AND B.CID = C.CID)
    OR
    (B.CID = C.PID AND B.PID = C.CID))
    AND
    B.SITE = C.SITE
    There may or may NOT be related records in Table C. That's the problem. This is where I need the outer join to get the all the records of the 1st two joins and only those that apply from the last join.
    Your help will be greatly appreciated.

    I'd create two queries, a join from b to c in each of those manners and then UNION ALL the results together.
    drop table junk_a;
    create table junk_a (
      id number );
    drop table junk_b;
    create table junk_b (
      id number,
      pid number,
      cid number,
      site varchar2(80) );
    drop table junk_c;
    create table junk_c (
      pid  number,
      cid  number,
      site  varchar2(80) );
    insert into junk_a values (1);
    insert into junk_b values (1, 12345, 67899, 'A');
    insert into junk_c values (12345, 67899, 'A');
    insert into junk_c values (67899, 12345, 'A');
    commit;
    SELECT b.*,
           c.site AS site_c
      FROM junk_b b,
           junk_c c
    WHERE c.pid(+) = b.pid
       AND c.cid(+) = b.cid
    UNION ALL
    SELECT b.*,
           c.site AS site_c
      FROM junk_b b,
           junk_c c
    WHERE c.cid(+) = b.pid
       AND c.pid(+) = b.cid;
    SELECT a.id,
           bc.pid,
           bc.cid,
           bc.site,
           bc.site_c
      FROM junk_a  a,
    SELECT b.*,
           c.site AS site_c
      FROM junk_b b,
           junk_c c
    WHERE c.pid(+) = b.pid
       AND c.cid(+) = b.cid
    UNION ALL
    SELECT b.*,
           c.site AS site_c
      FROM junk_b b,
           junk_c c
    WHERE c.cid(+) = b.pid
       AND c.pid(+) = b.cid
           )  bc
    WHERE bc.id(+) = a.id;

  • Outer join with IN operator

    Hi.
    I have two folders in Discoverer 10.1.2. These folder are joined with outer join on detail table:
    a.item1=b.item1(+)
    When I use both Folders in the worksheet and then add a condition for example
    b.item2 = 20, Discoverer generates SQL with the following conditions.
    a.item1=b.item1(+)
    b.item2 (+) = 20
    That's OK. The problem is that I need to use IN operator in the conditions, i.e. somethink like this:
    a.item1=b.item1(+)
    b.item2 (+) IN (20,30,40)
    This can be done in SQL using ANSI syntax:
    LEFT JOIN table b ON a.item1=b.item1, b.item2 IN (20,30,40)
    But I don't know how to achieve this in Discoverer Plus!
    (without using Custom folders in Administartor)
    Can anybody help, please?
    Thanks
    Jakub.

    Thanks for replies.
    blaplant:
    Yes, I need to report against a transaction database and I'm not allowed to change any table.
    Rod West:
    I know about the possibility of creating Custom folder as you suggest. Unfortunately our customer doesn't like this solution, because the condition "IN (20,30,40) " will be useful only for one user. Others wants differnet values in that condition.
    So using custom folder would mean to create many Custom folders in the EUL.
    However I like the idea of using session parameters.
    I'll try to create one Custom folder with session parameters. In the Plus there will be default value set on 20,30,40. So the current user can confirm this deafult value before the worksheet is run and future users can change parameters as they like.
    Moreover there could be another solution. Session parameters could be set directly by a calculation, maybe. So we can create a special worksheet for each user and no parameters in Plus will be necessary.
    Thanks for ideas.
    Jakub.

  • Update with Outer Join, round 2

    Thanks for those of you who helped me out on the first one (I never thought that you could use a one-row SELECT like that).
    However, here is a new version of my problem:
    I have three tables.
    Table_1 has a column that needs to be updated based on values in Table_2 and Table_3.
    Both Table_1 and Table_2 have values used to determine which Table_3 row to use.
    However, not every Table_1 row has a corresponding Table_3 row, in which case the Table_3 value to use is assumed to be 1.
    The tables and corresponding columns are:
    TABLE_1
    value_1 - the value to be updated
    key_2 - a pointer to TABLE_2
    key_3a - a pointer to TABLE_3, or a dummy value if there is no corresponding TABLE_3 record
    TABLE_2
    key_2 - the primary key
    key_3b - a secondary pointer to TABLE_3
    value_2 - a value to be used in calculating TABLE_1.value_1
    TABLE_3
    key_3a - the first part of the unique key
    ley_3b - the second part of the unique key
    value_3 - a value to be used in calculating TABLE_1.value_1
    If there is a row in table_3 that matches the table_1.key_3a and table_2.key_3b values (where table_2.key_2 = table_1.key_2):
    set table_1.value_1 = table_2.value_2 * table_3.value_3
    If there is no such row in table_3:
    set table_1.value_1 = table_2.value_2
    I want to do something like this:
    UPDATE table_1 t1
    SET value_1 =
    SELECT t2.value_2 * NVL(t3.value_3, 1)
    FROM table_2 t2
    LEFT JOIN table_3 t3
    ON (t3.key_3b = t2.key_3b and t3.key_3a = t1.key_3a)
    WHERE t2.key_2 = t1.key_2
    However, Oracle does not allow t1 to be referenced in the ON clause of the outer join.
    (Assume that every key_2 value in table_1 is in table_2 as well - it is only the key_3 value that can be a dummy.)
    If I move "t3.key_3 = t1.key_3" to the WHERE clause, then t1.value_1 is null for rows without the corresponding table_3 value.
    I can do it with a clone of table_1 using ROWIDs:
    UPDATE table_1 t1
    SET value_1 =
    SELECT t2.value_2 * NVL(t3.value_3, 1)
    FROM table_1 t1a
    JOIN table_2 t2
    ON t2.key_2 = t1a.key_2
    LEFT JOIN table_3 t3
    ON (t3.key_3b = t2.key_3b and t3.key_3a = t1a.key_3a)
    WHERE t1a.row_id = t1.row_id
    However, is there an easier way to do this using ANSI joins (i.e. without (+) syntax)?
    I have this feeling I am missing something reasonably obvious here.

    ddelgran wrote:
    Thanks for those of you who helped me out on the first one (I never thought that you could use a one-row SELECT like that).
    I want to do something like this:
    UPDATE table_1 t1
    SET value_1 =
    SELECT t2.value_2 * NVL(t3.value_3, 1)
    FROM table_2 t2
    LEFT JOIN table_3 t3
    ON (t3.key_3b = t2.key_3b and t3.key_3a = t1.key_3a)
    WHERE t2.key_2 = t1.key_2
    However, Oracle does not allow t1 to be referenced in the ON clause of the outer join.
    (Assume that every key_2 value in table_1 is in table_2 as well - it is only the key_3 value that can be a dummy.)
    If I move "t3.key_3 = t1.key_3" to the WHERE clause, then t1.value_1 is null for rows without the corresponding table_3 value.
    I can do it with a clone of table_1 using ROWIDs:
    UPDATE table_1 t1
    SET value_1 =
    SELECT t2.value_2 * NVL(t3.value_3, 1)
    FROM table_1 t1a
    JOIN table_2 t2
    ON t2.key_2 = t1a.key_2
    LEFT JOIN table_3 t3
    ON (t3.key_3b = t2.key_3b and t3.key_3a = t1a.key_3a)
    WHERE t1a.row_id = t1.row_id
    However, is there an easier way to do this using ANSI joins (i.e. without (+) syntax)?
    I have this feeling I am missing something reasonably obvious here.You might want to refer to my post in your original thread how to use join views in updates. You can use ANSI join syntax there, too:
    Re: Update with Outer Join
    You would end up with something like this (note: untested):
    UPDATE
      SELECT t1.value_1, t2.value_2 * NVL(t3.value_3, 1) as new_val
      FROM table_1 t1
      INNER JOIN table_2 t2 ON (t2.key_2 = t1.key_2)
      LEFT JOIN table_3 t3
      ON (t3.key_3b = t2.key_3b and t3.key_3a = t1.key_3a)
    SET value_1 = new_val;And again the same restrictions regarding key-preserved tables apply as described in the post referred to.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • SAP QUERY/INFOSET with OUTER JOIN

    Hi,
    I have created an infoset (SQ02) using two tables for SAP query.
    Table: AGR_TEXTS. Fields: AGR_NAME, SPRAS, LINE, TEXT.
    TABLE: AGR_FLAGS. Fields: AGR_NAME, FLAG_TYPE, FLAG_VALUE.
    Joined these two tables using outer join.  Defined the join condition as AGR_NAME = AGR_NAME.  Saved and Generated the infoset.
    Created SAP Query (SQ01) using the above created infoset.
    In the basic list,
    Marked AGR_NAME (AGR_TEXTS), TEXT, FLAG_VALUE as listed fields.
    Marked AGR_NAME (AGR_TEXTS), SPRAS, LINE, FLAG_TYPE as selection fields.
    Save the query.  When execute the query provided the inputs for all the selection fields in the selection screen as given below:
    AGR_NAME=Z*
    SPRAS=E
    LINE=00000
    FLAG_TYPE=LICENSE_01
    Executed the Query. 
    Got the results only the matched records as per the selection field FLAG_TYPE.
    But I want all the records from table AGR_TEXTS and matched records from table AGR_FLAGS.
    I want the report (output) as below,
    _AGR_NAME                                               TEXT                                                                                  FLAG_VALUE_
    ZCA_BASIC_ACCESS_GLOBAL     Non-critical basic access for all users.                                       53
    ZCA_BASIC_ENDUSER_ACCESS     UK:CA Basic Enduser Access     
    ZCA_BASIC_ENDUSER_ACCESS_UK     UK:CA Basic Enduser Access UK                                        52
    ZCA_BASIC_ENDUSER_SU52_UK     UK:CA Basic Enduser Access to change Parameter ID's     
    But I got the report (output) as below, 
    _AGR_NAME                                                TEXT                                               FLAG_VALUE_
    ZCA_BASIC_ACCESS_GLOBAL     Non-critical basic access for all users.     53
    ZCA_BASIC_ENDUSER_ACCESS_UK     UK:CA Basic Enduser Access UK     52
    Apprecited your help. Thanks.
    Code Formatted by: Alvaro Tejada Galindo on Dec 30, 2009 2:20 PM

    Identify a KF for which there are non-zero values for all accounts in the cube.
    Create the query with Account (from MP coming from both IO and cube) and this KF. KF will have 0 values for accounts not existing in the cube. Create a condition to show only the 0 value for the KF. This should show you all the accounts in the IO which are not in the cube.

  • Outer Join with Where Clause in LTS

    HI all,
    I have a requirement like this in ANSI SQL:
    select p1.product_id, p1.product_name, p2.product_group
    from product p1 left outer join product_group p2 on p1.product_id = p2.product_id
    and p2.product_group = 'NEW'
    In Regular SQL:
    select p1.product_id, p1.product_name, p2.product_group
    from product p1, product_group p2
    WHERE p1.product_id *= p2.product_id and p2.product_group = 'NEW'
    In OBIEE, I am using a left outer join between these two in Logical table Source, and also, Gave
    p2.product_group = 'NEW' in WHERE clause of LTS.
    This doesn't seem to solve purpose.
    Do you have any idea how to convert WHERE clause in physical query that OBIEE is generating to something like
    product p1 left outer join product_group p2 on p1.product_id = p2.product_id AND p2.product_group = 'NEW'
    I am using Version 10.1.3.4.1
    Creating an Opaque view would be my last option though.

    Hello
    I have read your post and the responses as well. and I understand that you have issues with the Outer Join with where Clause in LTS.
    Try this solution which worked for me (using your example ) -
    1. In the Physical Layer created a Complex join between PRODUCT and PRODUCT_GROUP tables and use this join relationship :
    PRODUCT.PROD_ID = PRODUCT_GROUP.PROD_ID  AND  PRODUCT_GROUP.GROUP_NAME = 'MECHANICAL' 
    2. In the General Tab of PRODUCT table LTS add PRODUCT_GROUP  table and select Join Type as Left Outer Join.
    3. Check Consistency and make sure there are no errors .
    when you run a request you should see the following query generated -
    select distinct T26908.PROD_ID as c1,
         T26908.PROD_NAME as c2,
         T26912.GROUP_NAME as c3
    from
         PRODUCT T26908 left outer join PRODUCT_GROUP T26912 On T26908.PROD_ID = T26912.PROD_ID and T26912.GROUP_NAME = 'MECHANICAL'
    order by c1, c2, c3
    Hope this works for you. If it does please mark this response as 'Correct' .
    Good Luck.

  • How to poll a blob using db adapter, with outer joins condition

    Hi All,
    We are trying to poll tables which contain column types as long and blob, we are using relationships in adapter and kept outer joins. by this we got select distinct t1.document .....etc
    distinct keyword cannot be used for blobs.
    is there any way to poll these tables having blob column types with outer joins.
    thanks a lot in advance,
    RR

    Hi,
    Procedure will be an explicit Invoke not Polling. If you can alter you design such that your BPEL process instead of polling gets triggered by some external entity (Java, PL/SQL, Scheduler, another BPEL etc.), you can put the data fetching logic in the procedure and call this procedure from your BPEL process to get the data. And your BPEL process is called periodically at an interval by an external entity.
    Also see if you can restrict the duplicate records at the database level itself. Polling, AFAIK, is limited in terms of customization and wouldn't be easy to customize. However, would like to learn a way if someone has.
    Regards,
    Neeraj Sehgal

  • Help requried with outer joins

    Hi All,
    I neeed a query help can any one please help me getting this done,
    for the below query
    select trunc(assumed_time_sql) AS date1,sum(rp.rebate_due)as sum1 from mn_date_dim dd ,mn_rebate_payment rp,mn_prc_program prc,mn_structured_doc sd
    where trunc(assumed_time_sql) in (TO_DATE('01-JUL-10','dd-mon-yy'),add_months(TO_DATE('01-JUL-10','dd-mon-yy'),-3),add_months(TO_DATE('01-JUL-10','dd-mon-yy'),-6),add_months(TO_DATE('01-JUL-10','dd-mon-yy'),-9))----input parameter
    AND trunc(dd.assumed_time_sql)=TRUNC(rp.start_date)
    AND prc.prc_program_id=rp.tiered_rebate_id
    AND sd.struct_doc_id=prc.struct_doc_id
    AND sd.struct_doc_id_num='M0000763'----input parameter
    group by trunc(assumed_time_sql);
    I am getting output as
    date1      sum1
    01-JAN-10      10
    01-APR-10     15
    01-JUL-10     20
    But i want my output to be as
    date1      sum1
    01-JAN-10      10
    01-APR-10     15
    01-JUL-10     20
    01-OCT-09 NULL
    I have tried with outer joins but this didn't help me
    Can any one please give me help in getting this done
    Thanks

    Hi,
    As SB pointed out, you'd better provide tables and data in order to be helped more efficiently.
    Anyway, you may want to investigate the use of NVL and/or DECODE so that you can translate NULL into valid values so they are returned to your select statement.
    HTH,
    Thierry
    Handle:  p78   
    Status Level:  Newbie (10) 
    Registered:  Mar 9, 2009 
    Total Posts:  60 
    Total Questions:  35 (30 unresolved)  Be kind to share your helpful / correct threads with other with marking them as ANSWERED
    Edited by: Urgent-IT on Feb 13, 2011 11:00 AM

Maybe you are looking for

  • Error Code: U43M1D207 installing Adobe Extension Manager CS5 5.0 Update

    I've searched for this error and read the replies. None of them helped. I'm running PS CS5 Extended, version 12.0.4. It was just moved onto a new computer. Other Adobe products include Acrobat XI Pro and Reader XI. After the software was installed on

  • Error with SVN

    I downloaded the svnant-1.0.0 and tried to run the sample build program given there. But i get the error - Cannot use javahl nor command line svn client What is javahl?? how can I resolve this ?? Help pls

  • SCCM 2012 : Deploying System Center Configuration Manager 2012, Required Desinging Help.

    Hi, I required some one to help designing an SCCM 2012 Solution. I dont have any knowledge on Design Part,  This is my first deployment My goal: Interconnect 3 remote offices and  The infrastructure is as follows:  Primary Site Server ( HQ )    : 100

  • How to retrive data from SQL or any database.

    Hi Experts,                   I am integrating FTP, DATABASE and SAP R/3 system.  1. FTP system stores xml files processed by customer requesting account info. 2. Database system ( SQL/Oracle)  consists of Details about Customer accounts. 3. Finally

  • Changing The Background Of An Image...

    Hello! I have an album cover (a CD, really) that I need to change the background color of. How can this be done via Photoshop CS3? Thanks!