niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Databases » Oracle
full outer join on 8i
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
Author Message
Brian Peasland
*nix forums Guru


Joined: 04 Apr 2006
Posts: 301

PostPosted: Wed Jul 19, 2006 1:15 pm    Post subject: Re: full outer join on 8i Reply with quote

Full outer joins were not implemented until Oracle 9i (a good reason to
upgrade that database?). Since you are using pre-9i, you will have to
rewrite the query to use a UNION of two OUTER JOINs, similar to the
following:

SELECT a.col1,a.col2,b.colA,b.colB
FROM tableA a, tableB b
WHERE a.someID = b.id (+)
AND a.ref LIKE '%4E%'
UNION
SELECT a.col1,a.col2,c.colA,c.colB
FROM tableA a, tableC c
WHERE a.someID = c.id (+)
AND a.ref LIKE '%4E%';

It looks like your UNION query is not written correctly.

HTH,
Brian


--
===================================================================

Brian Peasland
dba@nospam.peasland.net
http://www.peasland.net

Remove the "nospam." from the email address to email me.


"I can give it to you cheap, quick, and good.
Now pick two out of the three" - Unknown
Back to top
utefan001@gmail.com
*nix forums beginner


Joined: 11 Jul 2006
Posts: 4

PostPosted: Wed Jul 19, 2006 12:04 pm    Post subject: full outer join on 8i Reply with quote

On 8i, I have some rows that are not returning in a select query. The
sql is much bigger then this, but the basic problem is....

select *
from
tableA a,
tableB b,
tableC c
where a.someID = b.id(+)
and a.someID = c.id(+)
and a.ref like '%4E%'

Now keep in mind that (in this rare case) a.someID is null where a.ref
like '%4E%'
This is a sort of "triple check" finance report to ensure certain
project budget values have not been missed.

To get the row to return in 8i, I was hoping to apply what I read
here...
http://www.oreillynet.com/pub/a/network/2002/04/23/fulljoin.html

Note that the "(+)" is moved to the other side in the second select
below...
---------------------------------------
select *
from
tableA a,
tableB b,
tableC c
where a.someID = b.id(+)
and a.someID = c.id(+)
and a.ref like '%4E%'
UNION ALL
select *
from
tableA a,
tableB b,
tableC c
where a.someID(+) = b.id
and a.someID(+) = c.id
and a.ref like '%4E%'
-----------------------------------------
The error I get is ORA-01417
A table may be outer joined to at most one other table

Be nice ; )
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
The time now is Thu Dec 04, 2008 2:37 am | All times are GMT
navigation Forum index » Databases » Oracle
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Artica-postfix a full Open Source postfix management console dtouzeau Postfix 0 Mon Jun 16, 2008 9:46 pm
No new posts turn off autoreply when mailbox full bxd20 Postfix 1 Mon Mar 03, 2008 9:55 pm
No new posts /var FS full. What can be erased? Vlad Mfk FreeBSD 11 Wed Jul 19, 2006 7:19 pm
No new posts What to do? /var fs is full.. Vlad Mfk FreeBSD 1 Wed Jul 19, 2006 6:16 am
No new posts HOW-TO Full update from 5.3 to 6.0-6.1 ? Vlad Mfk FreeBSD 2 Wed Jul 19, 2006 5:52 am

Mortgage | Mortgages | Magic The Gathering Cards | Adverse Credit Remortgage | Proxy
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.5329s ][ Queries: 20 (0.4638s) ][ GZIP on - Debug on ]