BTW, I have seen the same behavior with Sybase database.
-----Original Message-----
From: Robert Manning [mailto:***@gmail.com]
Sent: Thursday, September 30, 2010 7:51 AM
To: Matt Dahlman
Cc: squirrel-sql-***@lists.sourceforge.net
Subject: Re: [Squirrel-sql-users] column aliases in MySQL
I was thinking that we could add support for this in the dialects.
The dialects support project vendor and version, so as long as we can determine the versions where the behavior exists, then this would be a viablw approach.
Rob
Post by Matt DahlmanSetting 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
Gerd,
That is awesome! I look forward to seeing that change come down the pipe.
Post by Gerd Wagner"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
Date: 09/24/2010 06:37 PM
Subject: Re: [Squirrel-sql-users] column aliases in MySQL
________________________________
Post by Gerd WagnerHas anyone else noticed that when querying a MySQL db a field alias
doesn't correctly show up in the query result header?
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
"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/sql1
2/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
https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users
----------------------------------------------------------------------
-------- 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
https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users
------------------------------------------------------------------------------
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-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users
**********************************************************************
E-mail sent through the Internet is not secure. Western Asset
therefore recommends that you do not send any confidential or
sensitive information to us via electronic mail, including social
security numbers, account numbers, or personal identification
numbers. Delivery, and or timely delivery of Internet mail is not
guaranteed. Western Asset therefore recommends that you do not send
time sensitive or action-oriented messages to us via electronic
mail.
**********************************************************************