I actually found the reason for this behaviour. MySQL Connector/J
5.x's implementation has been changed not to return column labels but
their names, that is the original columns' names. According to
http://bugs.mysql.com/bug.php?id=21596, the reason for changing the
implementation was to make it more JDBC compliant. So it's not a bug,
it's actually a feature.

Since SQLTransformer uses getColumnName(), no column aliases make it
into the output. Should SQLTransformer's implementation be altered
then?

Those who use MySQL Connector/J 5.x and rely on aliases should use the
useOldAliasMetadataBehavior-option in their jdbc-URL. This works from
Connector/J 5.0.4 onward.

Thanks again, Tobia, for pointing me in that direction!
-Stefan

2007/2/22, Stefan Hübner <[EMAIL PROTECTED]>:
Thanks Tobia,

I'm working with MySQL too. Maybe I should have a look at their docu.

-Stefan

2007/2/22, Tobia <[EMAIL PROTECTED]>:
> Stefan Hübner wrote:
> > Dev at weitling <[EMAIL PROTECTED]>:
> > > select a.name as aName, a.id as aID, b.id as bID, b.name as bName
> >
> > no, disappointingly enough, that doesn't work.
>
> It works here, using MySQL.
> Maybe it depends on the SQL engine?
>
> If you can't get the "as" keyword to work, you can always use some XSLT
> to tell them apart or to rename them:
>
> <xsl:template match="sql:rowset/sql:row/sql:id[position() = 1]">
>
> <xsl:template match="sql:rowset/sql:row/sql:id[position() = 2]">
>
>
> Tobia
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to