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

[ psqlodbc-Bugs-1002054 ] SQLSetDescField with SQL_DESC_INDICATOR_PTR has no effect.

From: <noreply(at)pgfoundry(dot)org>
To: noreply(at)pgfoundry(dot)org
Subject: [ psqlodbc-Bugs-1002054 ] SQLSetDescField with SQL_DESC_INDICATOR_PTR has no effect.
Date: 2008-11-28 11:11:20
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-odbc
Bugs item #1002054, was opened at 2007-02-16 14:30
You can respond by visiting:

Category: None
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Nobody (None)
Assigned to: Nobody (None)
Summary: SQLSetDescField with SQL_DESC_INDICATOR_PTR has no effect.

Initial Comment:
I discovered this as a side effect of something that seems to have changed. Seemingly, setting SQL_DESC_TYPE clears any information set during SQLBindCol (this is very different behaviour to all other ODBC drivers). Attempting to get around this by subsequently re-setting the indicator pointer seems to have no effect. Looking in pgapi30.c, it seems that this is the case: 

                case SQL_DESC_DATA_PTR:
                        opts->bindings[row_idx].buffer = Value;
                case SQL_DESC_INDICATOR_PTR:
                        tptr = opts->bindings[row_idx].used;
                        if (Value != tptr)
                                ret = SQL_ERROR;
                case SQL_DESC_OCTET_LENGTH_PTR:
                        opts->bindings[row_idx].used = Value;
                case SQL_DESC_OCTET_LENGTH:
                        opts->bindings[row_idx].buflen = CAST_PTR(SQLLEN,
                case SQL_DESC_PRECISION:
                        opts->bindings[row_idx].precision =

note, unlike all other options, SQL_DESC_INDICATOR_PTR doesn't seem to have any effect. 

This all came about trying to determine why SQLFetch was throwing an error on a null data fetch (log file attached), erronously claiming that the strlen_or_ind pointer was null. 


Comment By: Dominic Smith (dominic_smith)
Date: 2008-11-28 11:11

sorry, looks like I forgot to respond to this. The snapshot DLL corrected this problem for us. 


Comment By: Hiroshi Inoue (hinoue)
Date: 2007-02-17 22:58

IIRC this bug was fixed in 8.2.0201(2).
Could you try the snapshot dll at 


Comment By: Nobody (None)
Date: 2007-02-16 14:31

Forgot to mention, this is psqlodbc version 8.02.0200, working against PostgreSQL version 8.2. 


You can respond by visiting:

pgsql-odbc by date

Next:From: noreplyDate: 2008-11-28 11:32:47
Subject: [ psqlodbc-Bugs-1010515 ] Small negative decimal values are mistaken for non-negative
Previous:From: noreplyDate: 2008-11-28 11:08:58
Subject: [ psqlodbc-Bugs-1002204 ] Error in conversion to SQL_NUMERIC_STRUCT

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