On Jun 12, 2:08 am, Tonkuma <tonk...@jp.ibm.comwrote:
Please shaw us your Procedure and the way to call the procedure.
I suspect that the data type mismatch reside in this isuue.
This same code works on other platforms. Also this is part of a bigger
application. If i write the exact same code as a small test
application it works fine. I cannot find the difference.
int db2esqlConnect(const char *databaseEnv,
const char *username,
const char *password,
ERRCB *ep)
{
EXEC SQL BEGIN DECLARE SECTION;
char dbsql[10];
char usersql[20];
char passwdsql[20];
short numTables;
EXEC SQL END DECLARE SECTION;
int rc;
long prev_code = 0;
strcpy(dbsql, databaseEnv);
memset(&sqlca, 0, sizeof(struct sqlca));
/* connect to database */
if (username && *username && password && *password) {
strcpy(usersql, username);
strcpy(passwdsql, password);
EXEC SQL CONNECT TO :dbsql USER :usersql USING :passwdsql;
}
else {
EXEC SQL CONNECT TO :dbsql;
}
if (SQLCODE == 0) {
strncpy(Sversion_, sqlca.sqlerrp, 8);
Sversion_[8] = '\0';
strcpy(dbname, databaseEnv);
}
else
{
return FALSE;
}
}