Subject | Re: [Firebird-Java] Columns names in resultset |
---|---|
Author | Catalin Florean |
Post date | 2008-08-10T21:18:01Z |
Hi Yves,
This is not the right list to post your question.
In very short: Yes, this is normal. It is not Firebird related it is
normal SQL behaviour.
Run your query using IB Console, EMS Quickdesk etc and you will see
that the table(s) aliase(s) is(are) not present in your result set.
If you have the same column several times in the result set you should
use something like this:
select C.NAME as name1, C.NAME as name2 from CUSTOMER C
and use getString("name1") ... will work.
Regards,
Catalin.
This is not the right list to post your question.
In very short: Yes, this is normal. It is not Firebird related it is
normal SQL behaviour.
Run your query using IB Console, EMS Quickdesk etc and you will see
that the table(s) aliase(s) is(are) not present in your result set.
If you have the same column several times in the result set you should
use something like this:
select C.NAME as name1, C.NAME as name2 from CUSTOMER C
and use getString("name1") ... will work.
Regards,
Catalin.
On Sun, Aug 10, 2008 at 9:45 PM, Yves Glodt <yg@...> wrote:
> Hello,
>
> see this example:
>
> 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 several
> left-joins on the same table, with different aliases, and I do not see
> how I can differentiate the colum names.
>
> Best regards,
> Yves
>
>