Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Reading Database with Outer Joins

by cadfael (Friar)
on Jan 13, 2003 at 17:03 UTC ( [id://226512]=note: print w/replies, xml ) Need Help??


in reply to Reading Database with Outer Joins

my $SQL_query; $SQL_query = qq {SELECT A.DISPLAY_ORDER, A.NAME PARENT_NAME, B.NAME CHILD_NAME FROM CATEGORY A, CATEGORY B WHERE B.ID_PARENT_CATEGORY(+) = A.ID_CATEGORY AND A.DISPLAY_ORDER != -1 ORDER BY DISPLAY_ORDER};
Just a suggestion -- Oracle, SQL Server, Sybase, and others tend to use idiosyncratic ways of expressing joins. Using the ANSI join specifications will make your code more portable between RDBMS implementations. For example:
SELECT A.DISPLAY_ORDER, A.NAME PARENT_NAME, B.NAME CHILD_NAME FROM CATEGORY A LEFT OUTER JOIN CATEGORY B ON B.ID_PARENT_CATEGORY = A.ID_CATEGORY
I know that Sybase, SQL Server, Postgres and Oracle all support ANSI joins, and I suspect there are others as well.

-----
"Computeri non cogitant, ergo non sunt"

Replies are listed 'Best First'.
Re: Reading Database with Outer Joins
by smersh (Friar) on Jan 13, 2003 at 21:24 UTC
    I agree that ANSI syntax is more portable (and less confusing when you work on multiple platforms), but I believe that this form is not supported by Oracle 8i (it does work in 9i).

    smersh

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://226512]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2024-04-18 01:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found