× 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.



Richard,

One workaround is to use as. The following should work:

select a.field as afield, b.field as bfield from a join b...

Then specify afield and bfield. I have found the JDBC driver can vary
widely
in this area depending on who wrote it. For example, Oracle will let
you use
a qualified name with their OCI driver. Their thin driver will fail.
Both work with
ordinal references. All work with as or ordinal reference.

David Morris

> -----Original Message-----
> From: Richard Dettinger [SMTP:cujo@us.ibm.com]
> Sent: Friday, November 16, 2001 4:49 AM
> To:   java400-l@midrange.com
> Subject:      RE: java code help...
>
>
> You can't qualify column names.  Sorry its just not allowed.  The
> specification states that if a column name exists multiple times in
a
> ResultSet that the column name applies to the first entry.
>
> You could write your SQL statement to give the columns unique names.
> That's the only work around available.
>
> BTW:  Your app will perform better if you use the column indexes
instead
> of
> the column names.  Part of why using names instead of column indexes
is so
> expensive is because you have to do a linear search of the names of
the
> columns in the ResultSet for just this reason.  If your ResultSet has
100
> rows and you are fetching the 100th row with a column name, you could
be
> spending an order of magnitude more time in the driver figuring out
what
> the column index is over actually doing the work of getting the
data.
>
> Sorry, dude... I'm a JDBC driver writer... I have to say those types
of
> things to the application programmers.  :-)
>
> Richard D. Dettinger
> AS/400 Java Data Access Team
>
> Democracy's enemies have always underestimated the courage of the
American
> people.
> It was true at Concord Bridge.  It was true at Pearl Harbor.  And it
was
> true today.
>
>          Rochester Post-Bulletin
>          Tuesday September 11, 2001



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.