I get SQLCODE -1390 when issuing the DB2 API "sqleatin" (attach to node) from a C++ program to attach to the default instance. Before issuing this API, my program first sets the environment variable DB2INSTANCE using the "putenv" system call. My application works just fine on all Solaris platforms. But it fails on some of the AIX boxes. Does anybody has any idea why it fails?
Application details: C++ programs using CLI and API calls
Database rel : DB2 UDB 7.1 (32 bit) Fix Pack 3
O/S Platform : AIX 4.3 (32 bit).
SQLCODE -1390 tells me that the DB2INSTANCE variable is not set or
set to an invalid instance. "putenv" command was executed successfully (after the putenv call, I used "getenv" call to check the current value of DB2INSTANCE and it shows the correct value).
I also tried my application after executing the "db2profile" script from
my session. Still getting the same error.