Friday, November 11, 2011

SQL0204N "SCHEMA.TABLE_NAME" is an undefined name

If you get below mentioned error

Exception in thread "main" COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/SUN64] SQL0204N  "SCHEMA.TABLE_NAME" is an undefined name.  SQLSTATE=42704
        at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(Unknown Source)
        at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(Unknown Source)
        at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.check_return_code(UnknownSource)
        at COM.ibm.db2.jdbc.app.DB2Statement.execute2(Unknown Source)
        at COM.ibm.db2.jdbc.app.DB2Statement.executeQuery(Unknown Source)
        at TestDB2.main(TestDB2.java:18)


As the error suggest, Possible reason could be Table name you are trying to access is not valid for that particular schema. Please check for proper Schema and Table name combination.