memset(sqlda, 0, (IISQDA_HEAD_SIZE + (number * IISQDA_VAR_SIZE)));
sqlda->sqln = number;
-
- stmt = bstrdup(query);
+
+ stmt = (char*)malloc(strlen(stmt)+1);
+ bstrncpy(stmt,stmt,strlen(stmt)+1);
EXEC SQL PREPARE s1 from :stmt;
if (INGcheck() < 0) {
- number = -1;
- goto bail_out;
+ free(stmt);
+ free(sqlda);
+ return -1;
}
EXEC SQL DESCRIBE s1 into :sqlda;
if (INGcheck() < 0) {
- number = -1;
- goto bail_out;
+ free(stmt);
+ free(sqlda);
+ return -1;
}
number = sqlda->sqld;
-
-bail_out:
free(stmt);
free(sqlda);
return number;
sqlda->sqln = numCols;
- stmt = bstrdup(query);
+ stmt = (char *)malloc(strlen(stmt)+1);
+ bstrncpy(stmt,stmt,strlen(stmt)+1);
EXEC SQL PREPARE s2 INTO :sqlda FROM :stmt;
char *stmt;
EXEC SQL END DECLARE SECTION;
- stmt = bstrdup(query);
+ stmt = (char *)malloc(strlen(query)+1);
+ bstrncpy(stmt,query,strlen(query)+1);
rowcount = -1;
EXEC SQL EXECUTE IMMEDIATE :stmt;
EXEC SQL END DECLARE SECTION;
EXEC SQL INQUIRE_INGRES(:errbuf = ERRORTEXT);
- memcpy(conn->msg, &errbuf, 256);
+ memcpy(conn->msg,&errbuf,256);
return conn->msg;
}