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

hi,
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.
Thanks

rv447 1 post Joined 01/14
04 Jan 2014

Hi, 
It looks like there is some problem with SQL Assistant. Take a look at this: http://my.safaribooksonline.com/book/databases/sql/9780983336310/chapter-4-data-conversions/title_attribute_for_data_colum
Hope this helps.

07 Jan 2014

hi,
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.
Thanks.

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.