From: | "Andrea Aime" <aaime(at)comune(dot)modena(dot)it> |
---|---|
To: | Postgres ODBC <pgsql-odbc(at)postgresql(dot)org> |
Subject: | Re: Driver errors with Autocad (please help) |
Date: | 2001-04-19 15:56:43 |
Message-ID: | 3ADF0ABB.2A7A799B@comune.modena.it |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-odbc |
I begin to see some light now that I've spent some hours looking
at the logs and at the source code. Autocad first prepares a
statement with SQLPrepare, and the statement looks like:
"SELECT CLASSE FROM tav974 WHERE SIAPK974=?"
Then it calls SQLNumResultCols, which in turn calls SC_pre_execute
and finally SQLExecute wich fails because there is still no
parameter binding. If I set "Parse statements = 1" then SQLNumResultCols
runs fine and returns 1, but the subsequent SQLDescribeCol fails
because it calls SC_pre_execute... That happens in the following code
(from results.c):
if (stmt->parse_status != STMT_PARSE_FATAL && stmt->fi &&
stmt->fi[icol])
{
if (icol >= stmt->nfld)
{
stmt->errornumber = STMT_INVALID_COLUMN_NUMBER_ERROR;
stmt->errormsg = "Invalid column number in DescribeCol.";
SC_log_error(func, "", stmt);
return SQL_ERROR;
}
mylog("DescribeCol: getting info for icol=%d\n", icol);
fieldtype = stmt->fi[icol]->type;
col_name = stmt->fi[icol]->name;
precision = stmt->fi[icol]->precision;
mylog("PARSE: fieldtype=%d, col_name='%s', precision=%d\n", fieldtype,
col_name, precision);
if (fieldtype > 0)
parse_ok = TRUE;
}
}
/*
* If couldn't parse it OR the field being described was not parsed
* (i.e., because it was a function or expression, etc, then do it the
* old fashioned way.
*/
if (!parse_ok)
{
SC_pre_execute(stmt); <======= HERE!!!!!!!
Now, it seems that this happens because stmt->fi[icol] doesn't get
properly initialized... ok, how can I solve it? Any suggestion would be
much appreciated.
Regards
Andrea Aime
From | Date | Subject | |
---|---|---|---|
Next Message | Braxton Beyer | 2001-04-19 16:01:12 | DB grid |
Previous Message | Tibor Laszlo | 2001-04-19 14:13:58 | RE: DB grid |