Skip site navigation (1) Skip section navigation (2)

Re: Re: Driver errors with Autocad (please help)

From: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>
To: andrea(dot)aime(at)comune(dot)modena(dot)it
Cc: Postgres ODBC <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: Re: Driver errors with Autocad (please help)
Date: 2001-04-20 00:35:57
Message-ID: 3ADF846D.BB5E0242@tpf.co.jp (view raw or flat)
Thread:
Lists: pgsql-odbc
Andrea Aime wrote:
> 
> 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... 

Isn't the second parameter of the SQLDescribeCol() zero ?

regards,
Hiroshi Inoue

In response to

Responses

pgsql-odbc by date

Next:From: Hiroshi InoueDate: 2001-04-20 01:04:40
Subject: Re: How to configure iodbc access to local postgres db?
Previous:From: Rob YampolskyDate: 2001-04-19 17:50:56
Subject: How to configure iodbc access to local postgres db?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group