× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



yeah they have to have that foreign key field.. I didn't think the i cared so long as the types and lens were in sync.

--- On Tue, 3/24/09, lgoodbar@xxxxxxxxxxxxxx <lgoodbar@xxxxxxxxxxxxxx> wrote:


From: lgoodbar@xxxxxxxxxxxxxx <lgoodbar@xxxxxxxxxxxxxx>
Subject: RE: use of SQL in Oracle vs. I
To: midrange-l@xxxxxxxxxxxx
Date: Tuesday, March 24, 2009, 3:28 PM


Any join criteria should match in data type. Join numeric to numeric, character to character, etc. You can use type conversions (i.e. cast, convert) to achieve this but at a performance penalty. DB2 since V5R4 will perform some implicit type conversions, but I am not brave enough to try them in a join - that is asking for reporting or data integrity issues, IMO.

Joins do not have to be on key columns (foreign key or indexed) but again there is a performance penalty for joining on non-index columns.

Join types (left, right, outer, exception) work the same regardless of the data types used.

I haven't used Oracle so can't comment on the specific join issue.

--Loyd

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Adam West
Sent: Tuesday, March 24, 2009 9:50 AM
To: Midrange Systems Technical Discussion
Subject: use of SQL in Oracle vs. I

Well good news, I may be back on the i soon. That wasn't too long.
 
The other thing is that my exp. in SQL is now largely Oracle. On the i, I was a lazy bum, using RPG and the old Query. But the new work would entail SQL Only. I was just wondering how the following is done on the i.
 
In Oracle.
1) A is a table with aid, field1 columns.
2) B is a table with bid, aid, field2 columns. (where bid is a foreign key from table A)

Select A.field1 , B. field2 from A inner join B
on B.aid = A.aid
where condition

Oracle join will give you error if the table entries doesnot match, the results may vary based on the type of join you are using.. (inner, left outer, right outer, full)

How is this on the i? also on the i, does the outer join have to have a foreign key in this case does the B table field need to be from the A table?

In the i, you can have a composite key where the field names don't have to match as long as they are the same type.



As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.