Outer join syntax - oracle 8i

Here is an Oracle 8i issue I've run into ....
I am trying to create a table that contains a record for each hour of the day (even if count is 0). I have a problem when I try a right outer join using the following syntax:
SELECT MDT.date_field, COUNT(*)
FROM MASTER_DATE_TABLE MDT, hsa_tgt.PICIS_OR POR
WHERE MDT.date_field = TO_CHAR(POR.OR_IN_DTTM,'YYYYMMDDHH24') (+)
AND TO_DATE(MDT.date_field,'YYYYMMDDHH24') >= '01-Jan-2006'
AND TO_DATE(MDT.date_field,'YYYYMMDDHH24') <= '31-Jan-2006'
GROUP BY MDT.date_field;
The problem 'SQL code no properly ended' only occurs if I use the TO_CHAR function (or any function for that matter) on the outer join line.
Is there a workaround? I did manage to create a temporary table and then successfully do an outer join in order to bypass having the to_char function in the join statement.
Maybe a union?
TIA

I had to put it in a subquery? (if that's what it's called)
SELECT a1.date_field DateAndHour, b1.OR_date, NVL(b1.record_count,0)
FROM  MASTER_DATE_TABLE a1,
              (SELECT TO_CHAR(b.OR_IN_DTTM,'YYYYMMDDHH24') OR_date, COUNT(*) record_count
            FROM hsa_tgt.PICIS_OR b
            GROUP BY TO_CHAR(b.OR_IN_DTTM,'YYYYMMDDHH24')) b1
WHERE a1.date_field  = b1.OR_date (+)
GROUP BY a1.date_field, b1.OR_date, b1.record_count
HAVING (TO_DATE(a1.date_field,'YYYYMMDDHH24') BETWEEN '01-Jan-2006' AND '31-Jan-2006')
ORDER BY a1.date_field;

Similar Messages

  • Outer Join Syntax in sql2k to Oracle Migration

    All of my existing SQL Server 2000 code is using the (INNER, LEFT OUTER, RIGHT OUTER) JOIN syntax which according to Oracle SQL Reference (A90125-01) is supported. The migration workbench seems to want to convert this to the old style syntax of putting (+) in the where clause conditions. I am therefore getting lots of warnings telling me that "complex outer joins are not reliably supported". Is there a setting somewhere that will tell the migration workbench to maintain (subject to required conversion) the original syntax format.

    Hi Doug,
    The issue you report has been tackled in a recent internal build released by the OMWB team. OMWB version 9.2.0.1.6 which is freely downloadable on the http:\\mtg.ie.oracle.com site. As I've mentioned, this is an internal release and is therefore not supported - although it is very stable and has already been used by several internal customers. We expect to have a fully supported release of OMWB available on OTN in December.
    In version 9.2.0.1.6, there is an option in the "Parse Options" tab on the Stored Procedures property sheet called "Generate Oracle 8i Outer Joins" - this setting is switched off by default in this build and would therefore preserve your ANSI compliant joins by default. Switching the setting on causes the OMWB parser to generate the joins in the old (+) Oracle syntax standard.
    I hope this helps,
    Tom.

  • OBIEE not applying outer join syntax to filters

    (Note: I've already thoroughly searched the forums before posting this. Thanks)
    My problem is the following:
    I'm trying to build a report that is a count from my fact table, grouped by month from my date dimension for a given year, resulting in 12 data points. The problem is that not all months have actual data, but I still need those months to show on the report with a count of zero. Typical simple reporting requirement.
    I have already done the obvious and within my business layer made the join between my fact table and my date dimension an outer join on the fact side, just like you'd do if writing the query by hand. And when tested by hand this includes all dates for the year anyway, and when coupled with the appropriate null test on the count measure I'd get my 12 data points with zeros were appropriate.
    The problem is that there are additional filters I need to apply on the fact data (there are a couple text-based code values that didn't warrant full tables themselves so are just degenerate dimensions directly on the fact table.)
    When these filters are applied at the Answer level, I'm only getting back the months that actually have data, and lose the months where the count should be zero. A check of the session log for the query that was generated shows the problem. While OBI properly generates the outer-join syntax for the join itself between the two tables (my date dim and fact table) it does NOT apply the outer-syntax to the constant-based filter against the fact, effectively negating the outer join.
    Actual query from the log (I simply changed the table aliases from the ugly T##### stuff OBI generates to something more readable for posting here):
    select D.DT_MONTH_NAME as c1,
    D.DT_MONTH_NUM as c2,
    I.INC_TYPE as c3,
    I.INC_EMP_GROUP as c4,
    sum(case when I.INC_KEY is null then 0 else 1 end ) as c5
    from DATE_DIM D, INCIDENT_F I
    where ( D.DATE_KEY = I.DATE_KEY (+) ) and ( D.DT_YEAR = 2010 and I.INC_EMP_GROUP = 'CONTRACTOR' )
    group by D.DT_MONTH_NUM, D.DT_MONTH_NAME, I.INC_TYPE, I.INC_EMP_GROUP
    order by c2
    You can see that the outer syntax (+) is applied to the join, but not to the filter on I.INC_EMP_GROUP. If I take this query and drop it in something like SQL Developer, it only returns the months with data. If I throw the (+) after I.INC_EMP_GROUP like I'd do if writing this by hand, the desired zero-months results pop back in.
    I have already searched the forums and while lots of people seem to have asked this question, the only solutions involve things like trickery in the business layer using dummy fact tables followed by manipulations at the report level etc. Unfortunately I can't rely on these as the system is eventually to be turned over to users who can't be expected to apply various hacks to write reports.
    Anyone ever get to the bottom of getting OBI to apply outer join logic in filters as well, when the filtered table is meant to be outer-joined to?
    Any comments are appreciated.
    John

    I know that this thread is a bit old thought it might be helpful to some one...
    The Issue is, when using Degener@teDimen$ion ( this is !nner joned to FACT tables in BMM) and if any of the dimensions {other than theDegener@teDimen$ion (Let us say Dim X) } have an ()uter join to any of the fact tables, and you were doing your analysis using Degener@teDimen$ion,  Dim X, Measure value you will face the following issues.
    when filtering the analysis on the ()uter join dimension ( Dim X), the IN filter will not work. Reason is that the filter is getting applied to both the Dimension and FACT tables and the values that exist in Dimension Dim X but not in FACT table wont show up.
         The above issue can be fixed by changing the join between the fact and Degener@teDimen$ion from inner to outer. I think this is a bug.. because  it is supposed to filter the fact  table after the entire outer joined result is obtained but not filter the fact table for the Dim X values and do a outer join. I think the BI should be intelligent enough.

  • "use ODBC outer join syntax on limits"  issues

    I'm converting a series of BQY's from Brio 6.6 to Hyperion 9.3. I have some questions about the "use ODBC outer join syntax on limits" option in the OCE. I sort of understand this option's purpose, but I don't completely understand the SQL I'm seeing. For example Brio 6.6 is generating the following SQL statement:
    SELECT * FROM tblA AL1 LEFT OUTER JOIN tblB AL38 ON (AL38.ParentID=AL1.ChildID AND
    AL38.Data='SomeData') WHERE ((NOT AL38.Action IS NULL))
    Now, Hyperion 9.3 generated the SQL statement as follows:
    SELECT * FROM tblA AL1 LEFT OUTER JOIN tblB AL38 ON (AL38.ParentID=AL1.ChildID AND
    AL38.Data='SomeData') AND (NOT AL38.Response IS NULL))
    My questions are:
    1) Why isn't the "NOT AL38.Action IS NULL" statement included in the outer join in Brio? I'm OK with the fact that it is not, but my limited understanding of the "use ODBC outer join syntax on limits" seems to indicate that it should end up there.
    2) The Hyperion SQL is returning incorrect results. How can I get Hyperion to generate the same SQL as Brio? And still use the OCE with "use ODBC outer join syntax on limits" selected? This setting is working fine for other BQY's.

    In the first post, I modified the actual table name I'm using, the following is my actual output:
    SQL> SELECT A0.name partName,A2.name usedPartName FROM WTPartUsageLink A1
    2 RIGHT OUTER JOIN (
    3 (SELECT A0.idA2A2,A0B.name FROM WTPart A0 INNER JOIN WTPartMaster A0B
    4 ON ((A0.idA3masterReference = A0B.idA2A2)))
    5 UNION ALL
    6 (SELECT A0.idA2A2,A0B.name
    7 FROM WTProduct A0 INNER JOIN WTProductMaster A0B ON ((A0.idA3masterRefer
    ence = A0B.idA2A2)))) A0
    8 ON (A0.idA2A2 = A1.idA3A5) LEFT OUTER JOIN
    9 (SELECT A2.idA2A2,A2.name FROM WTPartMaster A2
    10 UNION ALL
    11 SELECT A2.idA2A2,A2.name FROM WTProductMaster A2) A2
    12 ON (A1.idA3B5 = A2.idA2A2) ORDER BY partName DESC,usedPartName DESC;
    FROM WTProduct A0 INNER JOIN WTProductMaster A0B ON ((A0.idA3masterRefer
    ence = A0B.idA2A2)))) A0
    ERROR at line 7:
    ORA-00923: FROM keyword not found where expected
    SQL> select * from v$version;
    BANNER
    Oracle9i Enterprise Edition Release 9.2.0.1.0 - 64bit Production
    PL/SQL Release 9.2.0.1.0 - Production
    CORE 9.2.0.1.0 Production
    TNS for Solaris: Version 9.2.0.1.0 - Production
    NLSRTL Version 9.2.0.1.0 - Production
    Thanks,

  • Old outer join syntax produces different results from new syntax!

    I have inherited a query that uses the old outer join syntax but that is yielding correct results. When I translate it to the new outer join syntax, I get the results I expect, but they are not correct! And I don't understand why the old syntax produces the results it produces. Bottom line: I want the results I'm getting from the old syntax, but I need it in the new syntax (I'm putting it into Reporting Services, and RS automatically converts old syntax to new).
    Here's the query with the old outer join syntax that is working correctly:
    Code Snippet
    SELECT   TE = COUNT(DISTINCT T1.ID),
             UE = COUNT(DISTINCT T2.ID),
             PE = CONVERT(MONEY, COUNT(DISTINCT T2.ID)) / 
                  CONVERT(MONEY,COUNT(DISTINCT T1.ID))
    FROM     TABLE T1, TABLE T2
    WHERE    T1 *= T2
    In this query, much to my surprise, TE <> UE and PE <> 1. However, TE, UE, and PE seem to be accurate!
    Here's the query with the new outer join syntax that is working but not producing the results I need:
    Code Snippet
    SELECT   TE = COUNT(DISTINCT T1.ID),
             UE = COUNT(DISTINCT T2.ID),
             PE = CONVERT(MONEY, COUNT(DISTINCT T2.ID)) / 
                  CONVERT(MONEY,COUNT(DISTINCT T1.ID))
    FROM     TABLE T1 LEFT OUTER JOIN TABLE T2 ON T1.ID = T2.ID
    Though not producing the results I need, it is producing what would be expected: TE = UE and PE = 1.
    My questions:
    1) Can someone who is familiar enough with the old syntax please help me understand why TE <> UE and PE <> 1 in the first query?
    2) Can someone please tell me how to properly translate the first query to the new syntax so that it continues to produce the results in the first query?
    Thank you very much.

    How can we reproduce the issue?
    Code Snippet
    USE [master]
    GO
    EXEC sp_dbcmptlevel Northwind, 80
    GO
    USE [Northwind]
    GO
    SELECT
    TE
    = COUNT(DISTINCT T1.OrderID),
    UE = COUNT(DISTINCT T2.OrderID),
    PE = CONVERT(MONEY, COUNT(DISTINCT T2.OrderID)) /
    CONVERT(MONEY,COUNT(DISTINCT T1.OrderID))
    FROM
    dbo
    .Orders T1, dbo.Orders T2
    WHERE
    T1
    .OrderID *= T2.OrderID
    SELECT
    TE
    = COUNT(DISTINCT T1.OrderID),
    UE = COUNT(DISTINCT T2.OrderID),
    PE = CONVERT(MONEY, COUNT(DISTINCT T2.OrderID)) /
    CONVERT(MONEY,COUNT(DISTINCT T1.OrderID))
    FROM
    dbo
    .Orders T1
    LEFT OUTER JOIN
    dbo.Orders T2
    ON T1.OrderID = T2.OrderID
    GO
    EXEC sp_dbcmptlevel Northwind, 90
    GO
    Result:
    TE
    UE
    PE
    830
    830
    1.00
    TE
    UE
    PE
    830
    830
    1.00
    As you can see, I am getting same results.
    AMB

  • Oracle 8i Full Outer Join Syntax

    Can someone please help me run this on Oracle 8i:
    SELECT
    R.CUSTOMER_NUM,
    R.SURNAME_NM,
    R.FIRST_NM,
    R.STREET_NM,
    R.PROV_CD,
    R.CITY_NM,
    R.POSTL_CD,
    W.ADDR_TWO_DESC,
    C.RTL_CO_NUM,
    C.CARD_NUM
    FROM
    RTL_CUST R
    FULL OUTER JOIN WHLSL_CUST W ON (R.CUST_NUM = W.CUST_NUM)
    FULL OUTER JOIN CUSTOMER_CARD C ON (T.CUST_NUM = C.CUST_NUM)
    I only know the ANSI syntax. Whats the old one?

    Is this correct:
    SELECT R.CUST_NUM, R.SURNAME_NM, R.FIRST_NM, R.STREET_NM, R.PROV_CD, R.CITY_NM, R.POSTL_CD, W.ADDR_TWO_DESC, NULL AS RTL_CO_NUM, NULL AS CARD_NUM
    FROM CCD_RTL_CUST R, CCD_WHLSL_CUST W WHERE R.CUST_NUM (+) = W.CUST_NUM
    UNION
    SELECT R.CUST_NUM, R.SURNAME_NM, R.FIRST_NM, R.STREET_NM, R.PROV_CD, R.CITY_NM, R.POSTL_CD, W.ADDR_TWO_DESC, NULL AS RTL_CO_NUM, NULL AS CARD_NUM
    FROM CCD_RTL_CUST R, CCD_WHLSL_CUST W WHERE R.CUST_NUM = W.CUST_NUM (+)
    UNION
    SELECT R.CUST_NUM, R.SURNAME_NM, R.FIRST_NM, R.STREET_NM, R.PROV_CD, R.CITY_NM, R.POSTL_CD, NULL AS ADDR_TWO_DESC, C.RTL_CO_NUM, C.CARD_NUM
    FROM CCD_RTL_CUST R, CUST_CARD C WHERE R.CUST_NUM (+) = C.CUST_NUM
    UNION
    SELECT R.CUST_NUM, R.SURNAME_NM, R.FIRST_NM, R.STREET_NM, R.PROV_CD, R.CITY_NM, R.POSTL_CD, NULL AS , C.RTL_CO_NUM, C.CARD_NUM
    FROM CCD_RTL_CUST R, CUST_CARD C WHERE R.CUST_NUM = C.CUST_NUM (+);

  • Outer join with Oracle Syntax

    Hi, i'm new in oracle and ihave been working this query for reports for about 2 weeks, plz take a look on my query
    SELECT mmt.transaction_date "Transaction Date",
                msib.segment1 "Item",
                gcc.segment1||'-'||gcc.segment2||'-'||gcc.segment3||'-'||gcc.segment4||'-'||gcc.segment5||'-'||gcc.segment6||'-'||(nvl(gcc.segment7,'000000')) "account",
                (CASE mttype.transaction_type_name
                WHEN 'Average cost update' THEN
              ((nvl(mmt.new_cost,0) - nvl(mmt.prior_cost,0)) * nvl(mmt.quantity_adjusted,0)) + nvl(mmt.variance_amount,0)
                ELSE
                 (mmt.Primary_quantity * nvl(mmt.actual_cost, 0) + nvl(mmt.variance_amount, 0))
               END) "Transaction Value",
                mttype.description "Transaction Type",
                mmt.subinventory_code "Subinventory",
                ood.organization_code "Org",
                msib.Primary_UOM_Code "UOM",
                mmt.Primary_Quantity "Primary Quantity",
                mtr.description "Reason",
                mmt.transaction_reference "Reference"
    FROM mtl_material_transactions mmt,
             mtl_system_items_b msib,
             mtl_transaction_accounts mta,
             gl_code_combinations gcc,
             mtl_transaction_types mttype,
             Org_Organization_Definitions ood,
             mtl_transaction_reasons mtr
    WHERE mmt.transaction_date >= :P_DATE_FROM
               and mmt.transaction_date  < :P_DATE_TO +1
               and mmt.organization_id = :P_ORGANIZATION
               and msib.organization_ID = mmt.organization_ID 
               and msib.inventory_item_id=mmt.inventory_item_id
               and mta.transaction_id=mmt.transaction_id
               and gcc.code_combination_id = mta.reference_account
               and mttype.transaction_type_id=mmt.transaction_type_id
               and mmt.reason_id=mtr.reason_id(+)
               and ood.organization_id=mmt.organization_id
               and mttype.transaction_type_id = :P_TRANSACTION_TYPE
               and msib.segment1 = :P_ITEM
               AND gcc.segment2 = :P_ACCOUNTthe null values is on the mtl_material_transactions table, which is reason_id, subinventory_code, and transaction_reference
    the desired out put would be to show all the record on mtl_material_transactions with the null values
    so, did i put the right symbol for the outer join ??
    btw
    i have tried put the (+) on various places but it still no good, and i'm really at a loss

    user11174063 wrote:
    Hi, i'm new in oracle and ihave been working this query for reports for about 2 weeks, plz take a look on my query
    SELECT mmt.transaction_date "Transaction Date",
    msib.segment1 "Item",
    gcc.segment1||'-'||gcc.segment2||'-'||gcc.segment3||'-'||gcc.segment4||'-'||gcc.segment5||'-'||gcc.segment6||'-'||(nvl(gcc.segment7,'000000')) "account",
    (CASE mttype.transaction_type_name
    WHEN 'Average cost update' THEN
    ((nvl(mmt.new_cost,0) - nvl(mmt.prior_cost,0)) * nvl(mmt.quantity_adjusted,0)) + nvl(mmt.variance_amount,0)
    ELSE
    (mmt.Primary_quantity * nvl(mmt.actual_cost, 0) + nvl(mmt.variance_amount, 0))
    END) "Transaction Value",
    mttype.description "Transaction Type",
    mmt.subinventory_code "Subinventory",
    ood.organization_code "Org",
    msib.Primary_UOM_Code "UOM",
    mmt.Primary_Quantity "Primary Quantity",
    mtr.description "Reason",
    mmt.transaction_reference "Reference"
    FROM mtl_material_transactions mmt,
    mtl_system_items_b msib,
    mtl_transaction_accounts mta,
    gl_code_combinations gcc,
    mtl_transaction_types mttype,
    Org_Organization_Definitions ood,
    mtl_transaction_reasons mtr
    WHERE mmt.transaction_date >= :P_DATE_FROM
    and mmt.transaction_date  < :P_DATE_TO +1
    and mmt.organization_id = :P_ORGANIZATION
    and msib.organization_ID = mmt.organization_ID 
    and msib.inventory_item_id=mmt.inventory_item_id
    and mta.transaction_id=mmt.transaction_id
    and gcc.code_combination_id = mta.reference_account
    and mttype.transaction_type_id=mmt.transaction_type_id
    and mmt.reason_id=mtr.reason_id(+)
    and ood.organization_id=mmt.organization_id
    and mttype.transaction_type_id = :P_TRANSACTION_TYPE
    and msib.segment1 = :P_ITEM
    AND gcc.segment2 = :P_ACCOUNTthe null values is on the mtl_material_transactions table, which is reason_id, subinventory_code, and transaction_reference
    the desired out put would be to show all the record on mtl_material_transactions with the null values
    so, did i put the right symbol for the outer join ??
    btw
    i have tried put the (+) on various places but it still no good, and i'm really at a losshttp://www.lmgtfy.com/?q=oracle+outer+join+example

  • Outer Joins in Oracle 9i

    Post Author: wtfinc
    CA Forum: Data Connectivity and SQL
    After upgrading to Oracle 9i, the SQL queries generated by Crystal Reports XI contain a syntax errors when performing Outer Joins.  The particular error returned by Oracle is "Old Style Outer Join can not be used with ANSI Joins".  Does anyone know a work around short of changing the datbase connection to a command and rewriting the report?

    Post Author: Jagan
    CA Forum: Data Connectivity and SQL
    If you choose SQL Query from Crystal's Database menu, does the SQL have a combination of old and new syntax?

  • 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

  • SQL Server "LEFT OUTER JOIN" syntax

    Haven't seen a solution to this on the forum or in the docs.
    I've got 2 objects, Task and Role, that are linked in a M-M relationship.
    My tables are:
    T_TASKS
    T_TASKSROLES
    T_ROLES
    I am querying T_TASKS and joining on T_ROLES, but I need to use an outer join on T_ROLES.
    In SQL Server, my FROM clause SHOULD look like this:
    FROM (T_TASKSROLES t2 LEFT OUTER JOIN T_TASKS t1 ON t1.ID = t2.TASKID) LEFT OUTER JOIN T_ROLES t0 ON t0.ID = t2.ROLEID
    however, if I use eb.anyOfAllowingNone(_roles) in my ExpressionBuilder. TopLink creates a LEFT OUTER JOIN clause that looks like this:
    FROM T_ROLES t0 LEFT OUTER JOIN T_TASKS t1 ON ((t0.ID = T_TASKSROLES.ROLEID) AND (t1.ID = T_TASKSROLES.TASKID))
    I can see the logic in how it builds this clause. But, it doesn't parse in SQL Server.
    Is there a way to effect how TopLink generates the FROM clause for outer joins? I mean, I understand how to use the XXXPlatform.java source files and can change whether to use OuterJoin in the WHERE clause or not. But, I can't see anything in the platform class that would allow me to figure this out.
    I realize I could write SQL manually, but is there a way to do this so that the same code would work on SQL Server, Oracle, and Sybase (assuming the DatabaseLogin is configured appropriately)?
    It just seems like LEFT OUTER JOIN when joining M-M relationships isn't generating proper SQL. Is the TopLink SQL SQL92-compliant?
    Nate

    I should add that I have tried to change SQLServerPlatform to have shouldPrintOuterJoinInWhereClause() return "true". This embeds a "=*" in the join conditions in the WHERE clause.
    SQL Server 2000 still supports this syntax, but the "=*" isn't ALWAYS the correct operator. It is IMPORTANT to put the "*" on the correct side of the expression.
    TopLink always prints "=*", and it always puts it in the correct space, but the OPERATORS are not always in the correct order so you are creating a "left join" on the wrong table.
    So my other question, is it possible to FORCE TopLink to remember to put the outer join table in the RIGHT SIDE?
    Nate

  • How to use OUTER JOIN in Oracle Answers Filters?

    Hi, I need to have a filter on an 'Oracle Answers' report.
    The query from the NQQuery.log appears as below. (I have simplified the SELECT clause here for easy reading)
    SELECT t692.enquiry_business_route AS c1,
    t692.enquiry_id AS c11, t913.YEAR AS c12,
    t913.full_date AS c13, t666.surname AS c14,
    t666.post_code AS c15, t855.company_name AS c16,
    t983.notes AS c30
    FROM
    mkt_dw_enev_enhi_dim t983,
    mkt_dw_key_partner_dim t855,
    mkt_dw_event_type_dim t821,
    mkt_dw_customer_dim t666,
    mkt_dw_time_dim t913,
    mkt_dw_enquiry_event_fact t692
    WHERE (
    t692.enquiry_id = t983.enqu_id
    AND t666.customer_dim_key = t692.customer_dim_key
    AND t692.event_date_time_key = t913.time_dim_key
    AND TRUNC(t983.event_date)= t913.FULL_DATE
    AND t692.event_type = t821.event_type_dim_key
    AND t692.key_partner_dim_key = t855.key_partner_dim_key
    AND t821.event_type_category = 'RECEIVE_FEE'
    AND t913.YEAR = 2009
    and t692.enquiry_id = 535986
    For the following two lines I would like to have the OUTER JOIN.
    AND t692.event_type = t821.event_type_dim_key(+)
    AND t821.event_type_category(+) = 'RECEIVE_FEE' (THIS IS THE FILTER CONDITION, AT THE MOMENT IT DOESN'T WORK WITH OUTER JOIN SYMBOL)
    Please could you let me know the best way of achieving the above.
    Thanks
    Srikanth

    In the BMM layer in the join condition you will be able to specify the join to be (left, right or full outer join).
    You can even add the required table in the LTS(logical table source) and also specify a left, right or full outer join there as well.
    There is an interesting work around as mentioned in the below blog to get to the Outer join results with out changing anything in rpd but in Answers.
    http://obiee101.blogspot.com/2008/11/obiee-outerjoin-workaround.html
    Hope it helps
    Thanks
    prash

  • Multiple Outer join in ORACLE 8.1.6

    Hi ,
    Can anybody suggest me how can i use multiple outer join on one table. I'm using ORACLE 8.1.6.
    I know this version of oracle doesnt support this. But is there anmy other wa\y I can achieve this.
    Thanks amd Regards
    Deependra

    Tricky question - but I went through this about 3 months ago, and found a good thread on here that explains it pretty well.
    check out Re: Outer join a table with two diff table
    You basically will have to create an inline view with one outer join in there, and then a second outer join on the outside. Read through the posts in that thread and it should help!

  • SQL 92 Outer Join Syntax and Funtion.

    When i am trying to use {fn substring(..)} or {oj table} in sql query to make it database independent, oralce driver does not support this.
    Could any one explain the above issue?
    If so, How do i use it? Explain the syntax a bit.
    Thanks in Advance,
    Ramani.

    I should add that I have tried to change SQLServerPlatform to have shouldPrintOuterJoinInWhereClause() return "true". This embeds a "=*" in the join conditions in the WHERE clause.
    SQL Server 2000 still supports this syntax, but the "=*" isn't ALWAYS the correct operator. It is IMPORTANT to put the "*" on the correct side of the expression.
    TopLink always prints "=*", and it always puts it in the correct space, but the OPERATORS are not always in the correct order so you are creating a "left join" on the wrong table.
    So my other question, is it possible to FORCE TopLink to remember to put the outer join table in the RIGHT SIDE?
    Nate

  • Change Outer Join Syntax

    Post Author: jasonp1980
    CA Forum: Data Connectivity and SQL
    I am currently using a ODBC driver provided by Esker to link into an IBM Informix Database 4.2When compiling a link in Crystal the SQL for this comes out as shown bellow with a syntax error. FROM   table1 LEFT OUTER JOIN table2But if I amend this to as bellow it works  FROM   table1, OUTER table2How can I change the term used in Crystal XI (11) for outer joins, I found some documentation on how to do this for version 7 (link bellow) but not for XI, thanks for any help. http://technicalsupport.businessobjects.com/KanisaSupportSite/search.do;jsessionid=0762FD2EDFF69A9AD85E7FB81E7E6573?cmd=displayKC&docType=kc&externalId=c2003023&sliceId=&dialogID=360384&stateId=1%200%20356275  

    Post Author: V361
    CA Forum: Data Connectivity and SQL
    Jason, Save out a copy of the report, and then open it,  if you use a command, you should be able to put your own SQL in.  Database, set datasource, create new connection, select your data source,  select add command.
    Your SQL statement will go in the command.

  • Outer Join Syntax

    I have an SQL statement with an outer join which works just fine, but when I go and add an "UPPER" function to one of the where statements, I get and error message indicating that my Command is not properly ended (Oracle 8I). Why?
    Select ECD_ID, to_char(DATE_OF_SUBMISSION, 'MM/DD/YYYY') as Date_Of_Submission
    from ECD_Project_State_Log, code_tbl a, code_tbl b, users u
    where ECD_ID = 1
    and UPPER(CURR_PROJECT_STATE) = UPPER(a.code_Name) (+)
    and REQ_PROJECT_STATE = b.code_Name (+)
    and REVIEWED_BY = u.User_id (+)
    order by Date_Of_Submission;

    Try this:
    and UPPER(CURR_PROJECT_STATE) = UPPER(a.code_Name(+))
    SQL> select e.ename, d.loc from emp e, dept d where d.deptno = upper(e.deptno)(+) ;
    select e.ename, d.loc from emp e, dept d where d.deptno = upper(e.deptno)(+)
    ERROR at line 1:
    ORA-00936: missing expression
    SQL> select e.ename, d.loc from emp e, dept d where d.deptno = upper(e.deptno(+)) ;
    ENAME      LOC
    CLARK      NEW YORK
    KING       NEW YORK
    MILLER     NEW YORK
    SMITH      DALLAS
    ADAMS      DALLAS
    FORD       DALLAS
    SCOTT      DALLAS
    JONES      DALLAS
    ALLEN      CHICAGO
    BLAKE      CHICAGO
    MARTIN     CHICAGO
    JAMES      CHICAGO
    TURNER     CHICAGO
    WARD       CHICAGO
               BOSTON
    15 rows selected.
    SQL> disconnect
    Disconnected from Oracle9i Enterprise Edition Release 9.2.0.3.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.3.0 - Production
    SQL>

Maybe you are looking for

  • HT204022 How to restore photos deleted photo stream???

    I'm a bit of a newbee to forums and macs.... I have an iphone and have always manually used the USB and copy & paste photos onto my PC. A couple of days ago I installed iCloud onto my PC which installed Okay and created a new photo steam folder as pa

  • File adapter created file permissions at OS

    Hi, We have a file adapter scenario and once we run the scenario at OS level the file is being created with following permissions. <b>-rw-r----- </b>  1 xisadm   sapsys    19789000 Oct 10 17:01 File10024322.txt So it is not being processed further ti

  • Why handling units need to be packed again?

    Hello Guru's,        I am finding this very strange, my scenarios is we have HU's received in QI stock. Now we are removing some goods for sampling via MIGO >>GI>>MT 331. When delivery and later TO is created, the system asks for confirming TO, the T

  • Bacth duplication check

    hello, any body please help. my client is using external batch no during order confirmation. but he wants to control the duplicancy of batch no. if there is any duplicancy it should not allow. how can i restrict. pls suggest me. Thanks & Regards Bhak

  • Re-downloading deleted songs? (with a twist)

    Hey all, So I got a new iPhone and downloaded the new iTunes (haven't used either in many years) and I figured 'what the heck ill figure it out.' So in my haste I started clicking the "cloud" icon next to most of my albums thinking I had to download