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.

Similar Messages

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

  • How to use outer join on 2 tables with Oracle 8i

    Could anyone tell me the Oracle 8i syntax equivalent to :
    select user.name, city.adress, contry.name
    from user
    left outer join city on (user.rCity = city.code)
    left outer join country on (user.rCountry = country.code)
    I tried following :
    select user.name, city.adress, contry.name
    from user, city, contry
    where user.rCity (+) = city.code
    and user.rCountry (+) = country.code
    but displayed following error :
    ORA-01417: a table may be outer joined to at most one other table
    Thank you

    Logically I would expect a user to have a city and a country, or not. In that case the outer join should be on the other tables. Making your query:
    select user.name, city.adress, country.name
    from user, city, country
    where user.rCity = city.code (+)
    and user.rCountry = country.code (+);

  • 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

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

  • Sql help (left outer join)

    Hi All,
    I am referring 2 regular tables from the HR schema which you get when you install Oracle 9i , Now the issue is that I want all the rows from my employees table even if the row doesnt have the salary equal to 2500.
    Here is my Sql:
    select e.employee_id
         , e.first_name
         , e.last_name
         , e.salary
         , e.department_id e_dep_id
         , d.department_id d_dep_id
         , d.department_name
         , d.location_id
    from employees e
    , departments d
    where 1 = 1
         And e.department_id = d.department_id(+) And e.SALARY = 2500
    I am achieving my result set from the below query though(its just a syntactical problem) , please help :
    select e.employee_id
         , e.first_name
         , e.last_name
         , e.salary
         , e.department_id e_dep_id
         , d.department_id d_dep_id
         , d.department_name
         , d.location_id
    from employees e left outer join
    departments d
    on e.department_id = d.department_id And e.SALARY = 2500
    Regards
    Rahul

    Mac_Freak_Rahul wrote:
    Well my requirement is to pull all the records from my driving table(ie employees) doesnt matter weather the condition satisfies or not. Just to add to that lets say I would need to bring another table and my join criteria involves data from the employees table and the third table(in this case I need to make sure that all the rows from my driving table remains and doesnt get filter out). Please help my only problem is of the new syntax of outer joins.
    Regards
    RahulRahul,
    Why do you want to use "oracle only syntax ( + )"? I highly recommend you to use ANSI syntax, it's much more readable:
    This is from Oracle's documents:
    Oracle recommends that you use the FROM clause OUTER JOIN syntax rather than the Oracle join operator. Outer join queries that use the Oracle join operator (+) are subject to the following > rules and restrictions, which do not apply to the FROM clause OUTER JOIN syntax:
    You cannot specify the (+) operator in a query block that also contains FROM clause join syntax.
    The (+) operator can appear only in the WHERE clause or, in the context of left-correlation (that is, when specifying the TABLE clause) in the FROM clause, and can be applied only to a column > of a table or view.
    If A and B are joined by multiple join conditions, then you must use the (+) operator in all of these conditions. If you do not, then Oracle Database will return only the rows resulting from a > simple join, but without a warning or error to advise you that you do not have the results of an outer join.
    The (+) operator does not produce an outer join if you specify one table in the outer query and the other table in an inner query.
    You cannot use the (+) operator to outer-join a table to itself, although self joins are valid. For example, the following statement is not valid:
    -- The following statement is not valid:
    SELECT employee_id, manager_id
    FROM employees
    WHERE employees.manager_id(+) = employees.employee_id;
    However, the following self join is valid:
    SELECT e1.employee_id, e1.manager_id, e2.employee_id
    FROM employees e1, employees e2
    WHERE e1.manager_id(+) = e2.employee_id;
    The (+) operator can be applied only to a column, not to an arbitrary expression. However, an arbitrary expression can contain one or more columns marked with the (+) operator.
    A WHERE condition containing the (+) operator cannot be combined with another condition using the OR logical operator.
    A WHERE condition cannot use the IN comparison condition to compare a column marked with the (+) operator with an expression.
    A WHERE condition cannot compare any column marked with the (+) operator with a subquery.Best Regards,
    Gokhan
    If this question is answered, please mark appropriate posts as correct/helpful and the thread as closed. Thanks

  • INNER JOIN, OUTER JOIN

    Isn't the inner join and outer join clauses used on oracle? Why not if it's possible?

    They are. As a matter of fact, there's certain situation where oracle recommend using the standard syntax and not oracle's as I quote:
    "Oracle recommends that you use the FROM clause OUTER JOIN syntax rather than the Oracle join operator."
    See
    http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm#sthref3175

  • Oracle OUTER JOIN on more than one table

    Hi!
    Friends, please help with this urgent problem: How can an outer join be written on more than one table?
    An SQL Server query:
    SELECT * from a INNER JOIN b on a.id = b.id LEFT OUTER JOIN c ON c.id = a.id AND c.id = b.id
    works fine with SQL SERVER
    But Oracle query:
    SELECT * from a,b,c WHERE a.id = b.id AND a.id = c.id (+) AND b.id = c.id (+)
    gives an error: OUTER JOIN cannot be used on more than one table? Why?
    I use OracleDriver from classes12.zip to connect to Oracle8i database.
    Please, help!

    The Oracle 8i and later SQL reference reads that the following "join_types" are supported and under this syntax it does not limit the LEFT OUTER JOIN (syntax the same as SQLServer example in original note) to two tables as implied in these notes:
    The join_type indicates the kind of join being performed:
    Specify INNER to indicate explicitly that an inner join is being performed. This is the default.
    Specify RIGHT to indicate a right outer join.
    Specify LEFT to indicate a left outer join.
    Specify FULL to indicate a full or two-sided outer join. In addition to the inner join, rows from both tables that have not been returned in the result of the inner join will be preserved and extended with nulls.
    You can specify the optional OUTER keyword following RIGHT, LEFT, or FULL to explicitly clarify that an outer join is being performed.

  • ANSI SQL 92 SYNTAX OUTER JOIN PERFORMANCE ISSUE

    Good Morning
    Could anyone explain why the excution time for these two (ment to be identical)
    queries run so differently.
    oracle syntax execution time 1.06 seconds
    select COUNT(*) from
    PL_EVENT_VIEW pev,
    PL_EVENT_STAFF_VIEW pesv
    WHERE pev.EVENT_ID=PESV.EVENT_ID(+)
    AND pev.WEEKS=PESV.WEEK_NUM(+)
    AND pev.event_id=2520
    ansi sql 92 syntax execution time 7.05 seconds
    select COUNT(*) from
    PL_EVENT_VIEW pev
    LEFT JOIN PL_EVENT_STAFF_VIEW pesv
    ON (pev.EVENT_ID=PESV.EVENT_ID
    AND pev.WEEKS=PESV.WEEK_NUM)
    WHERE pev.event_id=2520
    Thanks
    David Hills

    BTW Oracle outer join operator (+) and ANSI SQL OUTER JOIN syntax are NOT equivalent. Consider following:
    DROP TABLE T1;
    CREATE TABLE T1 (C1 NUMBER);
    DROP TABLE T2;
    CREATE TABLE T2 (C2 NUMBER);
    DROP TABLE T3;
    CREATE TABLE T3 (C3 NUMBER);
    -- Following SELECT works:
    SELECT COUNT(*)
         FROM T1, T2, T3
         WHERE C2 = C1
              AND C3(+) = C1
    COUNT(*)
    0
    -- But:
    SELECT COUNT(*)
         FROM T1, T2, T3
         WHERE C2 = C1
              AND C3(+) = C1
              AND C3(+) = C2
    AND C3(+) = C1
    ERROR at line 4:
    ORA-01417: a table may be outer joined to at most one other table
    -- However with ANSI syntax:
    SELECT COUNT(*)
         FROM T1
         JOIN T2 ON (C2 = C1)
         LEFT JOIN T3 ON (C3 = C1 AND C3 = C2)
    COUNT(*)
    0

Maybe you are looking for

  • Is there ever to be .vcs/.ics support?

    I get many appointment notifications via email, my business relies on it. With the email is a .vcs (vCal) attachment containing all the relevant information. Also attached is a .vcf (vCard) file with customer contact info. iPhone Mail app opens impor

  • Event 55, Ntfs. Causing System to lock up every hour.

    I checked the event log because my computer began locking up frequently last night. About a month ago I started regularly getting event 55 occurrences (after struggling to remove a browser hijacker virus) and now it looks like the last two event 55 o

  • 6 Plus: Screen rotation for pre-installed apps

    Having a bit of an argument on this one with the fiance, so some input would be greatly appreciated: With the Phone app on the iPhone 6 Plus, is the screen supposed to rotate or not? My fiance called Apple Support and was told that it was supposed to

  • My Apple TV buffers TV content but is fine with Movies

    I can easily watch a movie that I have purchased from the Apple TV with absolutely no buffering, but every time I try and watch a television show that I have purchased from the Apple TV it buffers in a way that I can't bear to watch it. This is clear

  • Performance and Stability Issues

    I added a new user account to my Mac and it seems to have caused a bunch of problems. I can't eject a Tech Tool Pro disc--it doesn't appear in the Finder. When I try to reboot or log out, it times out and I have to use the power button. Installation