pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hiroshi Inoue <inoue@tpf.co.jp>
To: lothar.behrens@lollisoft.de <lothar.behrens@lollisoft.de>
Cc: pgsql-odbc@postgresql.org
Subject: Re: SQLSetPos problem ?
Date: Wed, 13 Dec 2006 09:50:11 +0900
Message-ID: <457F4E43.108@tpf.co.jp> (raw)
In-Reply-To: <1165955153.386694.185060@f1g2000cwa.googlegroups.com>
References: <1165751917.708138.93120@j72g2000cwa.googlegroups.com>
	<457CACE1.2090907@tpf.co.jp>
	<1165848049.639913.7360@n67g2000cwd.googlegroups.com>
	<457DF1D9.7080804@tpf.co.jp>
	<1165955153.386694.185060@f1g2000cwa.googlegroups.com>

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



view thread (7+ messages)  latest in thread

Message-ID: <457F4E43.108@tpf.co.jp>
Permalink:  ../457F4E43.108@tpf.co.jp/
Also on:    postgresql.org/message-id/457F4E43.108@tpf.co.jp

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: inoue@tpf.co.jp, lothar.behrens@lollisoft.de
  Subject: Re: SQLSetPos problem ?
  In-Reply-To: <457F4E43.108@tpf.co.jp>
  References: <1165751917.708138.93120@j72g2000cwa.googlegroups.com> <457CACE1.2090907@tpf.co.jp> <1165848049.639913.7360@n67g2000cwd.googlegroups.com> <457DF1D9.7080804@tpf.co.jp> <1165955153.386694.185060@f1g2000cwa.googlegroups.com> <457F4E43.108@tpf.co.jp>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox