Re: My query table aliases don't exist in my application - Mailing list pgsql-jdbc

From Kevin Grittner
Subject Re: My query table aliases don't exist in my application
Date
Msg-id 4D483940020000250003A145@gw.wicourts.gov
Whole thread Raw
In response to My query table aliases don't exist in my application  (Hugo Garza <hiro2k@gmail.com>)
Responses Re: My query table aliases don't exist in my application  (Maciek Sakrejda <msakrejda@truviso.com>)
List pgsql-jdbc
Hugo Garza <hiro2k@gmail.com> wrote:

> I'm going a complex join on 5 tables and some of them have a
> column that repeats in two tables called "name". So I created an
> alias for each table, one of them called co, and in my application
> I do a result.getString("co.name"). But the application fails
> with: "The column name co.name was not found in this ResultSet."

Try giving the result column an alias:

select co.name as co_name

Then access it by the name you have given it.

Personally, I've never seen that other usage, and would never have
expected it to work.

-Kevin

pgsql-jdbc by date:

Previous
From: Hugo Garza
Date:
Subject: My query table aliases don't exist in my application
Next
From: Maciek Sakrejda
Date:
Subject: Re: My query table aliases don't exist in my application