Setting it based on the driver would be difficult. The reason is that MySQL changed its behavior back and forth several times between point releases. If you Google it, you'll find the change implemented, reverted, and implemented again.

So while a first guess would be that it makes sense to do it one way for Oracle, another for MySQL, another for PostgreSQL, etc... in fact you would need different options for MySQL 5.1.x vs 5.1.y vs 5.1.z.

Regards,
Matt


On 27 Sep 2010, at 8:26, epierce@wernervas.com wrote:

Gerd,

That is awesome!  I look forward to seeing that change come down the pipe.

> "Introduced a new general data type property 'Use column labels instead
of column names in result headers'.

Just thinking out loud... does it make sense to leave this config option in the user's hands, or could this automatically switch depending on which driver you're on?  If you had two db connections open for databases that handle the table alias differently, then the setting would apply to both sessions (possibly incorrectly).

Either way i'm happy w/the fix!

Eric



From:        Gerd Wagner <gerdhwagner@t-online.de>
To:        epierce@wernervas.com
Cc:        squirrel-sql-users@lists.sourceforge.net
Date:        09/24/2010 06:37 PM
Subject:        Re: [Squirrel-sql-users] column aliases in MySQL




Am 24.09.2010 21:51, schrieb epierce@wernervas.com:
> Has anyone else noticed that when querying a MySQL db a field alias
> doesn't correctly show up in the query result header?
>
> For example:
> SELECT p.name AS productName, c.name AS customerName
> FROM product p
> JOIN customer c ON p.custID = c.custID
> WHERE (whatever)
>
> The result headers will show 'name' for both fields instead of the field
> alias set in the query.
>
> FYI. I also use SquirrelSQL with an Informix db and it does not exhibit
> this issue.

This is a JDBC driver dependent issue. Some drivers return aliases as
column names others as labels. I just made it switchable. See change log
entry cited below:

"Introduced a new general data type property 'Use column labels instead
of column names in result headers'.
See Global Preferences --> Tab 'Data Type Controls'. Will be useful e.g.
for MySQL if Aliases are used in Select clauses."


or here

http://squirrel-sql.svn.sourceforge.net/viewvc/squirrel-sql/trunk/sql12/doc/src/main/resources/changes.txt?revision=5900


The change is available in our SVN repository and in coming versions and
snapshots


Gerd

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev_______________________________________________
Squirrel-sql-users mailing list
Squirrel-sql-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users