Page 1 of 1

DB2 connectivty problem

Posted: Fri Dec 04, 2009 7:31 pm
by BradMiller
I am trying to connect to DB2 database table using DB2 Enterprise stage,we have set the env variables in dsenv and able to read from some of the DB2 database tables but for others though we are able to import view the table data at import by plug-in metadata,we are not able to view the data when we try to write a query selecting single column.It throws the following error "DB2_Configure..DB2_UDB_API_6: [IBM][CLI Driver][DB2] SQL0206N "DSN8710.DEPT.DEPTNO" is not valid in the context where it is used. SQLSTATE=42703

DSTAGE-DB2CLI-0027`:`SQLExecDirect: Error executing statement 'SELECT DSN8710.DEPT.DEPTNO FROM PDB2.DSN8710.DEPT '. See following DB2 message for details.
DB2_Configure..DB2_UDB_API_6.DSLink1: DSP.Open GCI $DSP.Open error -100."

Posted: Fri Dec 04, 2009 11:38 pm
by ray.wurlod
Is the schema name truly PDB2? Is the owner name truly DSN8710? Is the table name really DEPT? Is there really a column named DEPTNO in the DEPT table?

What happens if you do not qualify the column name? For example

Code: Select all

SELECT DEPTNO FROM PDB2.DSN8710.DEPT ;

Posted: Mon Dec 07, 2009 6:06 pm
by BradMiller
Thanks Ray for your input.Its the problem with the code generated by SQL Builder in DB2 API stage.When you write a user defined sql it works.