Subject | AW: [Firebird-Java] Columns names in resultset |
---|---|
Author | Steffen Heil |
Post date | 2008-08-10T19:55:07Z |
Hi
However to be one the safe side, I always use "as":
select c.name as c_name, d.name as d_name from tablec c, table d d where
c.id=d.id
rs.getString( "c_name" );
rs.getString( "d_name" );
This works for every database server and does not rely on renaming conventions
of particular servers.
Regardsm
Steffen
[Non-text portions of this message have been removed]
> see this example:Yes.
> select C.NAME from CUSTOMER C
> when I do rst.getString("C.NAME") it does not work, and the exception
> says that the columns name was not found in the result set.
> Doing rst.getString("NAME") works.
> Is this normal and expected?
> This behaviour gives me trouble since I have a query where I do severalI don't know how, but firebird is propably renaming the conflicting columns.
> left-joins on the same table, with different aliases, and I do not see
> how I can differentiate the colum names.
However to be one the safe side, I always use "as":
select c.name as c_name, d.name as d_name from tablec c, table d d where
c.id=d.id
rs.getString( "c_name" );
rs.getString( "d_name" );
This works for every database server and does not rely on renaming conventions
of particular servers.
Regardsm
Steffen
[Non-text portions of this message have been removed]