3 messages in com.mysql.lists.javaRE: How to get tablename when aliasin...| From | Sent On | Attachments |
|---|---|---|
| Helmut Leininger | 17 May 2003 09:54 | |
| Mark Matthews | 17 May 2003 14:04 | |
| JR Ruggentaler | 17 May 2003 21:23 |
| Subject: | RE: How to get tablename when aliasing is used![]() |
|---|---|
| From: | JR Ruggentaler (jr...@mpv.com) |
| Date: | 05/17/2003 09:23:30 PM |
| List: | com.mysql.lists.java |
Could you use select t.col1 as col1, t.col2 as col2 from mytable t?
J.R.
-----Original Message----- From: Mark Matthews [mailto:ma...@mysql.com] Sent: Saturday, May 17, 2003 4:05 PM To: Helmut Leininger Cc: ja...@lists.mysql.com Subject: Re: How to get tablename when aliasing is used
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Helmut Leininger wrote:
Hi,
I have something like
select t.col1, t.col2 from mytable as t
If I use the ResultSetMetaData method getTableName() it delivers "t". Is there a way to retrieve the origonal table name ("mytable") ?
Thanks Helmut
Only MySQL-4.1 sends the 'original' names as part of the protocol, as MySQL versions prior to 4.1 don't return the non-aliased names. The JDBC API provides no methods to retrieve these names, however. If needed, Connector/J could be extended to allow access to this data (it sometimes uses it internally). Until now, there hasn't been much call for it.
-Mark
- -- For technical support contracts, visit https://order.mysql.com/?ref=mmma
__ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Mark Matthews <ma...@mysql.com> / /|_/ / // /\ \/ /_/ / /__ MySQL AB, SW Dev. Manager - J2EE/Windows /_/ /_/\_, /___/\___\_\___/ Flossmoor (Chicago), IL USA <___/ www.mysql.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE+xqPxtvXNTca6JD8RAkM4AJ95JvteKf+QDobRa+iWbTPXUbC6FQCgyWu+ 48ISt1HlI59na/JxgF6flA4= =2AbV -----END PGP SIGNATURE-----
-- MySQL Java Mailing List For list archives: http://lists.mysql.com/java To unsubscribe: http://lists.mysql.com/java?unsub=jr...@mpv.com




