Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id DA1409FA373 for ; Tue, 12 Dec 2006 20:50:18 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 16329-05 for ; Tue, 12 Dec 2006 20:50:14 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34]) by postgresql.org (Postfix) with SMTP id 7CAA19FA394 for ; Tue, 12 Dec 2006 20:50:13 -0400 (AST) Received: (qmail 19864 invoked from network); 13 Dec 2006 09:50:10 +0900 Received: from unknown (HELO ?100.0.32.170?) (100.0.32.170) by sd2.tpf-fw-c.co.jp with SMTP; 13 Dec 2006 09:50:10 +0900 Message-ID: <457F4E43.108@tpf.co.jp> Date: Wed, 13 Dec 2006 09:50:11 +0900 From: Hiroshi Inoue User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) MIME-Version: 1.0 To: "lothar.behrens@lollisoft.de" CC: pgsql-odbc@postgresql.org Subject: Re: SQLSetPos problem ? 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> In-Reply-To: <1165955153.386694.185060@f1g2000cwa.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/54 X-Sequence-Number: 8501 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