Oliver Jowett wrote:
> Philip Yarra wrote:
> So your suggested implementation would return incorrect information
> whenever there were aliases involved.
Thanks, I understand now. So the decision was to return nothing, rather
than something that's potentially wrong?
> We have no way of telling if aliasing has been done or not based on the
> data returned by the server, so we can't even do it only when no aliases
> are used.
Looks like Sybase came to the same question and decided that returning
the base table name was ok:
$ java -cp .:/home/philip/bin/jconn3.jar rsmd sybase3.prop
2006-09-22T15:50:39.206:QUERY: SELECT * FROM tempextest
2006-09-22T15:50:39.210:table name [tempextest]
2006-09-22T15:50:39.212:QUERY: SELECT * FROM tempextest tablealias
2006-09-22T15:50:39.215:table name [tempextest]
Oracle seems to have a very similar implementation to PostgreSQL:
$ java -cp .:/home/philip/bin/ojdbc14.jar rsmd oracle.prop
2006-09-22T15:53:59.882:QUERY: SELECT * FROM tempextest
2006-09-22T15:53:59.986:empty table name
2006-09-22T15:53:59.987:table name []
2006-09-22T15:53:59.989:QUERY: SELECT * FROM tempextest tablealias
2006-09-22T15:54:00.3:empty table name
2006-09-22T15:54:00.4:table name []
How about allowing the user to set a connection property so that the
(possibly-wrong-but-more-useful) call through to getbaseTablename is
done, so that *some* info comes back, with default of existing
behaviour? Or has that also been discussed and dismissed previously? :-)
Regards, Philip.
--
Philip Yarra
Senior Software Engineer, Utiba Pty Ltd
philip@utiba.com