Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id D15F59FA311 for ; Mon, 18 Dec 2006 19:40:41 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 73401-05 for ; Mon, 18 Dec 2006 19:40:31 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sd.tpf.co.jp (smtp.tpf.co.jp [210.161.239.34]) by postgresql.org (Postfix) with SMTP id 464B89FA28E for ; Mon, 18 Dec 2006 19:40:33 -0400 (AST) Received: (qmail 28038 invoked from network); 19 Dec 2006 08:40:31 +0900 Received: from unknown (HELO ?100.0.32.170?) (100.0.32.170) by sd2.tpf-fw-c.co.jp with SMTP; 19 Dec 2006 08:40:31 +0900 Message-ID: <458726EE.6040906@tpf.co.jp> Date: Tue, 19 Dec 2006 08:40:30 +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: Still SQLSetPos problem even with minimal sample, SQL_NULL_DATA 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> <1166311419.967140.317720@16g2000cwy.googlegroups.com> <1166482424.555811.255330@j72g2000cwa.googlegroups.com> In-Reply-To: <1166482424.555811.255330@j72g2000cwa.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/77 X-Sequence-Number: 8524 lothar.behrens@lollisoft.de wrote: > Hi, > > I have implemented setting SQL_COLUMN_IGNORE, SQL_NULL_DATA and have > added functions > to indicate this state. > > I have made a 'small' sample application to demonstrate this, but I > still use my ODBC wrapper > classes in that sample application. You may get access to the full > code. Ask for it! > > The first insert is with valid foreign keys and no column set to NULL. > This insert works. > My next insert has set the columns to NULL, but it inserts the values > of the last insert. > Currently I have made an array of long (cbBufferLength[2]) and set this > explicitely short before > the call to SQLSetPos: > > if (mode == 1) // 1 means adding > cbBufferLength[1] = SQL_NULL_DATA+SQL_COLUMN_IGNORE; > else > cbBufferLength[0] = SQL_NULL_DATA+SQL_COLUMN_IGNORE; At first glance, adding SQL_NULL_DATA(=-1) and SQL_COLUMN_IGNORE(=-6) seems to have no meaning. If you really want to set to NULL on SQL_ADD, please set SQL_NULL_DATA. If you want to set DEFAULT on SQL_ADD, please set SQL_COLUMN_IGNORE. regards, Hiroshi Inoue