DB2JDBCException - An undefined Column name was detected!!!
1 posts in topic
Flat View  Flat View

Posted By:   Ed_Davison
Posted On:   Monday, August 9, 2004 05:53 AM

Hi I get this error message when trying to SQL a native AS400 file using the native driver running on the as400.

The SQL statement works fine when I select from other tables in the same library but throws this exception each and everytime I try to access this one particular table.

The SQL statement is a basic select * from library.table where pempno = 23823

Pempno definitely exists in the table as a zoned decimal.

Any ideas?

Re: DB2JDBCException - An undefined Column name was detected!!!

Posted By:   Ed_Davison  
Posted On:   Wednesday, August 11, 2004 02:15 AM

See this by a Richard D. Dettinger, I got this off midrange.com ---

"You can't qualify column names. Sorry its just not allowed. The
specification states that if a column name exists multiple times in a
ResultSet that the column name applies to the first entry.

You could write your SQL statement to give the columns unique names.
That's the only work around available.

BTW: Your app will perform better if you use the column indexes instead of
the column names. Part of why using names instead of column indexes is so
expensive is because you have to do a linear search of the names of the
columns in the ResultSet for just this reason. If your ResultSet has 100
rows and you are fetching the 100th row with a column name, you could be
spending an order of magnitude more time in the driver figuring out what
the column index is over actually doing the work of getting the data.

Sorry, dude... I'm a JDBC driver writer... I have to say those types of
things to the application programmers. :-)"
About | Sitemap | Contact