Page 1 of 1

SQL0206N & SQLSTATE=42703 ..not valid in the context err

Posted: Wed Feb 22, 2012 11:47 am
by Developer9
Hi Everyone,

I am using DB2 API stage to read the data with with "custom sql query"..

Code: Select all

job..EMP_MTH: [IBM][CLI Driver][DB2/AIX64] SQL0206N  "PRD_LN" is not valid in the context where it is used.  SQLSTATE=42703SQL0206N  "PRD_LN" is not valid in the context where it is used.  SQLSTATE=42703
I verified schema name and owner name ..Its Strange for one table its giving this type of error out of 30-40 tables I used the same way .
More particularly ,when I give table name as Parameter (Given parameter :EMP_MTH=EMP_M01 )..why this is happening any :idea:

Code: Select all

"SELECT EMP_NO,....CCS.EMP_M01 "..Working fine

"SELECT EMP_NO,....CCS.EMP_MTH "...Giving error 
Thanks for the Input

Posted: Wed Feb 22, 2012 7:01 pm
by qt_ky
The SQL0206N error indicates that the PRD_LN column does not exist in the table you queried, which is EMP_MTH. Apparently that column exists in the other tables. You can check by using DB2 command line, the DB2 client, or by importing the metadata from that table into DataStage.