Query with column rename not working! (SQLServer/JDBC-ODBC bridge)
843854Jul 2 2004 — edited Jul 2 2004Hi,
I was wondering if anybody could help. I am translating some stuff from ASP to JSP and ran into an SQL query that goes like this:
String SQLQuery = "SELECT myTable.myColumn renamedColumn FROM myTable";
which is perfectly legal in SQL Server. I get the stuff from myTable, no problem, and the column's name is locally indeed renamedColumn.
Under the sun.jdbc.odbc.JdbcOdbcDriver, however, trying to do something like:
string myResult = results.getString("renamedColumn");
throws an SQL exception with the message "Index not found".
And if I don't rename the column and try:
myResult = results.getString("myTable.myColumn");
also gives the same problem.
Anybody know what to do?
[P.S, the reason why I have to rename my column is because I have two tables with an identical column name and need both for a search page]