I am facing a issue in psqlodbc driver, that when i try to get the value of same colum twice throug ADO,odbc driver sends the empty value on second iteration.e.g if we get 'value1' of
colum 'a' and we try to fetch the same value through ADO in loop then
we will get a empty string.
After investigation ,I found that odbc driver is explicit returning
NO_DATA_FOUND on the column if that is already fetched .following is the code snippt in convert.c.
if (pgdc->data_left == 0)
if (pgdc->ttlbuf != NULL)
pgdc->ttlbuf = NULL;
pgdc->ttlbuflen = 0;
pgdc->data_left = -2; /* needed by ADO ? */
We can fix this
by not returning NO_DATA_FOUND on the column value which is already
fetched .We can allow the driver to copy same value in client buffer
even that was fetched already.I have written C code to test this
scenario.Following is the code snippet which will help in more
if(SQL_NO_DATA == rc)
Till here lets say we have fetched the data on driver.
Now following call of SQLGetData() will copy the value of colum '1' (second param) into the client buffer.which is good.
printf("Date one call = [%s]\n",szData);
Now we have same following call of SQLGetData() and trying to get same
colum('1') second time.But the driver is returing NO_DATA_FOUND in code
and no string copied in buffer.
printf("Data 2 call = [%s]\n",szData);
I hope I am able to describe the whole scenario.We can fix this by not
returning NO_DATA_FOUND. But I wanted to confirm that if NO_DATA_FOUND is explicitly returned.
pgsql-odbc by date
|Next:||From: imad||Date: 2009-05-14 14:52:01|
|Subject: Re: psqlodbc driver returning empty string|
|Previous:||From: prashanth k p||Date: 2009-05-11 11:57:52|
|Subject: Re: client encoding mismatch|