All Forums Connectivity
02 Jan 2014
Column Title Impact in Java - issue

I have a table with same column title(not the column names), runing a SQL on it from Java is returing same values for both the columns, it is because of same column title, but same SQL in SQL Assitant returns correct values, where can i find and confirm if same title is reason. is there a driver documentation which states this behaviour.
Also, Did explict column alias in SQL used in java.. now results are correct. let me know.

rv447 1 post Joined 01/14
04 Jan 2014

It looks like there is some problem with SQL Assistant. Take a look at this:
Hope this helps.

07 Jan 2014

Thanks, im looking more from Java JDBC drive perspective, how resultset values are populated, if two columns has same title with different values. does value of first gets assigned to second as well. i know thats how its happening now.. just wanted to see the reference of this behaviour. or is it a bug in teradata jdbc driver.

tomnolan 594 posts Joined 01/08
08 Jan 2014

Are you using ResultSet getter methods that have a columnName argument? If so, then it is expected that you will only be able to retrieve one of the column values if there are two columns with the same name.
Instead, use the ResultSet getter methods that have an integer columnIndex argument.

You must sign in to leave a comment.