Folks, Is it mandatory to use an ALIAS when we are doing some operation on the column?
Ex: select upper(col1) from table1
when i am trying to retrieve the resultset by rs.getString("col1"), it was giving this exception
COM.ibm.db2.jdbc.DB2Exception: [IBM][JDBC Driver] CLI0611E Invalid column name. SQLSTATE=S0022
when I changed the query to:
select upper(col1) as col1 from table1 and used rs.getString("col1"), it is working fine.
So, is it mandatory to use an ALIAS when some function like upper,trim,lower was applied on a column???
I am using: DB2 8.2, Type 2 driver
Thanks