Can someone please help me point out issues / ways to debug this Issue on MS Visual Studio 2012 (Express). (DB2 Express C Version 10.1.2)
I have checked the manuals and the SQLSTATE refers to an invalid character in the Query String. As far as I understand, there isn't any! Nor am I able to figure it out from the Error message produced. Please help!
/* Define a SELECT SQL Statement That uses a Paramter
Marker. !! Protect from Buffer Overflow !! */
strcpy((char *) sqlQuery, "SELECT EMPNO, LASTNAME FROM ");
strcat((char *) sqlQuery, "EMPLOYEE WHERE JOB = ?");
Best Regards, Guy Przytula
Database Software Consultant
Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
Information Server Datastage Certified http://www.infocura.be
I'm sorry I am editing my earlier reply, but I'm not sure if this is appropriate. I have managed to figure out the Issue I guess. I had compiled the code and used "Unicode Character Set" which resulted in an invalid string being passed to SQLPrepare ( ) . (Not sure how it returned a successful completion code though!)
I compiled the code again, and this time used "Multi-Byte Character Set". I can finally see the SQL query in the trace log and the error that I get is "[IBM][CLI Driver][DB2/NT] SQL0204N "DB2ADMIN.EMPLOYEE" is an undefined name. SQLSTATE=42704" and it looks like an access Issue.
Pardon me, but I have never worked with a relational database before. I know this is something silly but please help!
Thanks for the help. The trace clinched it! I have managed to setup the Right Schemas, granted appropriate privileges to the user ID and I've been able to fetch a record from the table. Much appreciated. Thanks!