Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

8 Join Table... Access to Oracle... Think your good? Try a..

 
   Database Forums (Home) -> Oracle RSS
Next:  Deadlock in single session  
Author Message
mgillesp

External


Since: Oct 19, 2006
Posts: 2



(Msg. 1) Posted: Thu Oct 19, 2006 8:34 am
Post subject: 8 Join Table... Access to Oracle... Think your good? Try and Master this one!
Archived from groups: comp>databases>oracle>misc (more info?)

OK, so I was given this very large query that is trying to create a
very large grid table to hold all the necessary information. I really
dont like it and suggested breaking it up, but the boss is the boss,
and they want to keep it the same so implementation doesn't change :S.
Below I will show the FROM section of the Access query, and the
attempt to match that query in the Oracle WHERE clause by another
developer.

The problem is that currently they are getting 3000 extra records, so
they want me to find the problem.

Access (I tried to structure it nicely):

FROM

(PERSON LEFT JOIN RD_GENDER ON PERSON.GENDER_ID = RD_GENDER.VALUE_ID)
RIGHT JOIN
(((((
[EMHealth Subject Type] RIGHT JOIN
(b_collection_pt RIGHT JOIN b_Data_From_Specimn ON
b_collection_pt.SPECIMN_ID = b_Data_From_Specimn.SPECIMN_ID)
ON
[EMHealth Subject Type].HSBJ_ID = b_Data_From_Specimn.HSBJ_ID)

LEFT JOIN

b_get_prod_data_Crosstab ON b_Data_From_Specimn.SPECIMN_ID =
b_get_prod_data_Crosstab.SPECIMN_ID)

LEFT JOIN

HMN_HSBJ ON [EMHealth Subject Type].HSBJ_ID = HMN_HSBJ.HSBJ_ID)

LEFT JOIN

ANML_HSBJ ON [EMHealth Subject Type].HSBJ_ID = ANML_HSBJ.HSBJ_ID)

LEFT JOIN

RD_GENDER AS RD_GENDER_1 ON ANML_HSBJ.GENDER_ID = RD_GENDER_1.VALUE_ID)


ON
PERSON.PERSON_ID = HMN_HSBJ.PERSON_ID.

(I know its ugly......)


Oracle:

WHERE

WHERE
B_DATA_FROM_SPECIMNS.HSBJ_ID = EMHEALTH_SUBJECT_TYPE.HSBJ_ID(+)
AND
B_DATA_FROM_SPECIMNS.SPECIMN_ID = B_COLLECTION_PT.SPECIMN_ID(+)
AND
B_DATA_FROM_SPECIMNS.SPECIMN_ID =
B_GET_PROD_DATA_CROSSTAB.SPECIMN_ID(+)
AND
PERSON.GENDER_ID = RD_GENDER.VALUE_ID(+)
AND
ANML_HSBJ.GENDER_ID=RD_GENDER_1.VALUE_ID(+)
AND
HMN_HSBJ.PERSON_ID=PERSON.PERSON_ID(+)
AND
HMN_HSBJ.HSBJ_ID(+)=EMHEALTH_SUBJECT_TYPE.HSBJ_ID
AND
ANML_HSBJ.HSBJ_ID(+)=EMHEALTH_SUBJECT_TYPE.HSBJ_ID


Now some of the Right and Left Joins are mixed up between the Oracle
and Access versions, but I think they did this because Oracle doesn't
allow two outer joins on the same table in one query.

As I said before, I was thinking unions might be needed. But if anyone
has any ideas, or in some miracluous way, an answer.... Post er up!

Thanks for any help you could give,

Mitch Gillespie

 >> Stay informed about: 8 Join Table... Access to Oracle... Think your good? Try a.. 
Back to top
Login to vote
DA Morgan

External


Since: May 16, 2005
Posts: 1301



(Msg. 2) Posted: Thu Oct 19, 2006 9:27 am
Post subject: Re: 8 Join Table... Access to Oracle... Think your good? Try and [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

mgillesp.TakeThisOut@uoguelph.ca wrote:

> Oracle:
>
> WHERE
>
> WHERE
> B_DATA_FROM_SPECIMNS.HSBJ_ID = EMHEALTH_SUBJECT_TYPE.HSBJ_ID(+)
> AND
> B_DATA_FROM_SPECIMNS.SPECIMN_ID = B_COLLECTION_PT.SPECIMN_ID(+)
> AND
> B_DATA_FROM_SPECIMNS.SPECIMN_ID =
> B_GET_PROD_DATA_CROSSTAB.SPECIMN_ID(+)
> AND
> PERSON.GENDER_ID = RD_GENDER.VALUE_ID(+)
> AND
> ANML_HSBJ.GENDER_ID=RD_GENDER_1.VALUE_ID(+)
> AND
> HMN_HSBJ.PERSON_ID=PERSON.PERSON_ID(+)
> AND
> HMN_HSBJ.HSBJ_ID(+)=EMHEALTH_SUBJECT_TYPE.HSBJ_ID
> AND
> ANML_HSBJ.HSBJ_ID(+)=EMHEALTH_SUBJECT_TYPE.HSBJ_ID
>
>
> Now some of the Right and Left Joins are mixed up between the Oracle
> and Access versions, but I think they did this because Oracle doesn't
> allow two outer joins on the same table in one query.

Sure it does. You just need to code in-line views and then join them.
--
Daniel A. Morgan
University of Washington
damorgan.TakeThisOut@x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org

 >> Stay informed about: 8 Join Table... Access to Oracle... Think your good? Try a.. 
Back to top
Login to vote
mgillesp

External


Since: Oct 19, 2006
Posts: 2



(Msg. 3) Posted: Thu Oct 19, 2006 12:18 pm
Post subject: Re: 8 Join Table... Access to Oracle... Think your good? Try and Master this one! [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

> Sure it does. You just need to code in-line views and then join them.
> --
> Daniel A. Morgan
> University of Washington
> damorgan.DeleteThis@x.washington.edu
> (replace x with u to respond)
> Puget Sound Oracle Users Group
> www.psoug.org


Yeah, that's what I've done. Testing is about to commence!

Thanks,

Mitch
 >> Stay informed about: 8 Join Table... Access to Oracle... Think your good? Try a.. 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
How should I practise to join Oracle. - I am an engineering student in final year pursuing Computer Science. I have always been fascinated with Oracle. Can you suggest me ways on how I should proceed to prepare myself in order to get into Oracle. Thanks.

Access as frontend for Oracle / NET as frontend for Oracle - Hi, I want to build an application with .NET Framework C#/ and Oracle as Database, or with Access as Frontend for Oracle. What are the advantages / disadvantages of these ways (security, speed, query, etc.) ? Which one would be your choice and way? ....

data type TABLE of Oracle - Hi, I'm writing a PL/SQL program to send emails. I copied a email packages from the web and it works fine. However, I have problem if I put the email ids as variable instead of hardcoded in the calling program. The package header is as follows: create...

selecting from oracle nested table - The task I have is to output some messages from a procedure in a package. The package is run in a shell script from plsql by piping the output from the proc to a file. There is a need to have 4 different types of messages in the report with some sorting...

reading data from Oracle to Access - Hi, I need to connect an Access (probably 2003) to an Oracle 9i db. I will have readonly rights on the Oracle db. (just need to place the data from oracle into access, no updates necessary from access to oracle) I'm aware that i have to use ODBC driver...
   Database Forums (Home) -> Oracle All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]