Liste des Groupes | Revenir à co vms |
On 6/5/2025 10:55 AM, Arne Vajhøj wrote:Updates fail with:>
TDS DBLIB error: Unable to allocate sufficient memory
TDS OS error: error 0
TDS error in dbcmd
But I suspect that is a bug in my code.
Mysterious.
>
stat = dbfcmd(con, "INSERT INTO t1 VALUES(%d, '%s')", f1, f2esc);
>
fails.
>
char buf[1000];
sprintf(buf, "INSERT INTO t1 VALUES(%d, '%s')", f1, f2esc);
stat = dbcmd(con, buf);
>
works.
>
And DBLIB.C contains:
>
RETCODE
dbfcmd(DBPROCESS * dbproc, const char *fmt, ...)
{
va_list ap;
char *s;
int len;
RETCODE ret;
>
tdsdump_log(TDS_DBG_FUNC, "dbfcmd(%p, %s, ...)\n", dbproc, fmt);
CHECK_CONN(FAIL);
CHECK_NULP(fmt, "dbfcmd", 2, FAIL);
>
va_start(ap, fmt);
len = vasprintf(&s, fmt, ap);
va_end(ap);
>
if (len < 0) {
dbperror(dbproc, SYBEMEM, errno);
return FAIL;
}
>
ret = dbcmd(dbproc, s);
free(s);
>
return ret;
}
>
????
>
Les messages affichés proviennent d'usenet.