Re: SQLSetPos problem ? - Mailing list pgsql-odbc

From Hiroshi Inoue
Subject Re: SQLSetPos problem ?
Date
Msg-id 457F4E43.108@tpf.co.jp
Whole thread Raw
In response to Re: SQLSetPos problem ?  ("lothar.behrens@lollisoft.de" <lothar.behrens@lollisoft.de>)
Responses Re: SQLSetPos problem ?  ("lothar.behrens@lollisoft.de" <lothar.behrens@lollisoft.de>)
List pgsql-odbc
lothar.behrens@lollisoft.de wrote:
> Hiroshi Inoue schrieb:
>
>> lothar.behrens@lollisoft.de wrote:
>>> Hiroshi Inoue schrieb:
>>>
>>>> lothar.behrens@lollisoft.de wrote:
>>>>> Hi,
>>>>>
>>>>> I am using unixodbc in the latest version and psqlodbc 07.03.0200.
>>>>> Having many queries working
>>>>> good in my application one gives me this error, when updating a row.
>>>> The version 7.3.0200 is pretty old.
>>>> Please try the 8.2.xxxx version.
>>>>
>>> I need cursor functionality like first,back,next,last. Does the latest
>>> driver support it ?
>> Yes at least on Windows.
>
> Currently I have figured out, that my SQL_ADD statement fails
> (SQLSetPos).
> It seems, that I cannot insert new rows, because of foreign key
> constraints.
>
> Removing the NOT NULL clauses of that columns didn't helped.
>
> With PGAdmin I was able to test inserting such a row. That worked.
>
> Any ideas ?

How do you setting the foreign key column using PGadmin ?

> If the bound columns having the wrong value - such as a non exsisting
> foreign key -
> how must it be filled to indicate a NULL value ?
>
> I bind such a column that way:
>
> buffer = malloc((ColumnSize+1)*rows);
> memset(buffer, 0, (ColumnSize+1)*rows);
> ret = SQLBindCol(hstmt, column, SQL_C_CHAR, buffer, (ColumnSize+1),
> &cbBufferLength);
>
> Is that wrong ?

I'm afraid I'm misunderstanding your point.
Please set SQL_NULL_DATA to cbBufferLength to indicate the column is NULL.
Also set SQL_COLUMN_IGNORE to cbBufferLength to ignore the column.

regards,
Hiroshi Inoue

pgsql-odbc by date:

Previous
From: Caio Begotti
Date:
Subject: Re: possible odbc driver bug with postgresql-7.4
Next
From:
Date:
Subject: [ psqlodbc-Bugs-1000738 ] Wrong ODBC state (42P01 or 42P07) is returned on dropping/creating table