Sujet : Re: FreeTDS port to VMS V9.x on x86?
De : arne (at) *nospam* vajhoej.dk (Arne Vajhøj)
Groupes : comp.os.vmsDate : 05. Jun 2025, 17:47:05
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <101shm9$1l3ag$1@dont-email.me>
References : 1 2 3 4 5
User-Agent : Mozilla Thunderbird
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;
}
????
Arne