|
-
Hello Friends,
I've recently bumped into a problem when porting a small application from SQL Server to Oracle. The application uses quite a number of sql statements with INNER and OUTER JOIN syntax. While pure INNER JOINS are easy to rewrite by specifing the JOIN condition in WHERE clause, how to deal with OUTER JOINS?
For example: sql statement
SELECT * FROM A LEFT OUTER JOIN B ON A.ID = B.ID
How to implement it in Oracle? Also, I connect to Oracle using Oracle ODBC Driver - shouldn't it support ANSI SQL syntax? Why doesn't it recognize INNER and OUTER JOINS?
Thank you for your replies!
-
Hello
Oracle does support outer joins you can sue somethin similar to this
SELECT * FROM A
Where A.ID = B.ID(+);
note the (+) is the outer join operator
regards
hrishy
-
Hi,
So basically there's no way for oracle to recognize ANSI SQL syntax such as LEFT OUTER JOIN? Why doesn't Oracle ODBC driver support it?
I thought all odbc drivers need to support ansi standard?
My questions might sound stupid, but I'm trying to understand this problem. It seems like writing ansi compliant sql queries will not be a cure for cross-database code problem...
-
Only snide comments:
Keeping the business logic on the middle tier does not guarantee that one can replace the database with a completely different brand and version if the the data models are identical.
DB2 uses the same outer join syntax as SQL Server. In reading the first DB2 manual, I have come across numerous differences between DB2 and Oracle.
Good luck.
David Knight
OCP DBA 8i, 9i, 10g
-
Thanks, at least some databases follow standards...
But what are the reasons Oracle doesn't want to support ansi... to make our life harder?
-
I doubt that it will make you feel better, but Oracle is supporting the ANSI syntax in 9i. They even recommend that you use the ANSI syntax instead of the Oracle syntax (+). 
http://download-west.oracle.com/otnd...s2.htm#2054625
Heath
-
Virtually all mayor DB vendors have reached *ENTRY LEVEL* compliance with SQL92 standard, but one of them have reached a higher level than this. ENTRY level is the lowest of four levels that defines compliance with standard.
All of them specify they are ANSI/ISO compliant, but they never tell you the whole story.... Oracle is no better than any of other DB vendors regarding this isue, but also no worse than the others. INNER/OUTER join syntax is just one of the fragments in the standard, there are *many* others where Oracle is "more compliant" than others...
Jurij Modic
ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|