Tuesday, November 15, 2011

DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704

If you get below mentioned error

Exception in thread "main" com.ibm.db2.jcc.b.eo: DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=SCHEMA.TABLE_NAME, DRIVER=3.53.95
        at com.ibm.db2.jcc.b.bd.a(bd.java:676)
        at com.ibm.db2.jcc.b.bd.a(bd.java:60)
        at com.ibm.db2.jcc.b.bd.a(bd.java:127)
        at com.ibm.db2.jcc.b.gm.c(gm.java:2484)
        at com.ibm.db2.jcc.b.gm.d(gm.java:2461)
        at com.ibm.db2.jcc.b.gm.a(gm.java:1962)
        at com.ibm.db2.jcc.t4.db.g(db.java:138)
        at com.ibm.db2.jcc.t4.db.a(db.java:38)
        at com.ibm.db2.jcc.t4.t.a(t.java:32)
        at com.ibm.db2.jcc.t4.sb.h(sb.java:141)
        at com.ibm.db2.jcc.b.gm.bb(gm.java:1933)
        at com.ibm.db2.jcc.b.gm.a(gm.java:2799)
        at com.ibm.db2.jcc.b.gm.a(gm.java:604)
        at com.ibm.db2.jcc.b.gm.executeQuery(gm.java:588)

Possible reason could be Table do not present in that schema. Please make sure that you provide correct schema name and table name. Also check for typo in Table name or Schema name.

I got the above error when i mistakenly passed wrong table name for the schema. Hope it resolved your error.