19

I am getting this JDBC exception. I googled it but the explanation was very abstract.

DB2 SQL error: SQLCODE: -206, SQLSTATE: 42703

com.misys.liq.jsqlaccess.adapter.jdbcadapter.util.JDBCAdapterException: com.ibm.db2.jcc.a.SqlException: DB2 SQL error: SQLCODE: -206, SQLSTATE: 42703, 
praveen_mohan
  • 455
  • 2
  • 7
  • 15
  • I'm sure the DB2 reference manual contains a less abstract explanation. – mustaccio Jun 17 '14 at 11:22
  • you can have an attribute in your entity and this one isn't in your DB – senior Sep 05 '17 at 16:45
  • You skipped posting the SQLERRMC portion of the error message. This should indicate the column of your select statement that doesn't exist in the database. – Marcell Jan 24 '20 at 09:24
  • If you are using Hibernate api check the @Table(name = "table_name", schema="Schema_name") annotation value – Pekmezli Dürüm Aug 26 '21 at 10:26
  • In my case, it was that the table in my from included a schema name, but I then referred to a column with just the table name, not including the schema. So, lesson learned: when you include a schema name in a table name, give the table name as a (redundant, but necessary) alias. – Preacher Jul 19 '23 at 17:30

1 Answers1

52

That only means that an undefined column or parameter name was detected. The errror that DB2 gives should point what that may be:

DB2 SQL Error: SQLCODE=-206, SQLSTATE=42703, SQLERRMC=[THE_UNDEFINED_COLUMN_OR_PARAMETER_NAME], DRIVER=4.8.87

Double check your table definition. Maybe you just missed adding something.

I also tried google-ing this problem and saw this:

http://www.coderanch.com/t/515475/JDBC/databases/sql-insert-statement-giving-sqlcode

Fritz
  • 1,144
  • 1
  • 13
  • 21