Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wstfy-0003cG-K4 for pgsql-odbc@arkaria.postgresql.org; Fri, 06 Jun 2014 12:55:18 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Wstfx-00023y-U5 for pgsql-odbc@arkaria.postgresql.org; Fri, 06 Jun 2014 12:55:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Wstfx-00023c-A6 for pgsql-odbc@postgresql.org; Fri, 06 Jun 2014 12:55:17 +0000 Received: from 173-11-38-134-minnesota.hfc.comcastbusiness.net ([173.11.38.134] helo=johnspc.frickson.pvt) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Wstfq-0003uF-AU for pgsql-odbc@postgresql.org; Fri, 06 Jun 2014 12:55:16 +0000 Received: from [173.11.38.132] (173-11-38-132-Minnesota.hfc.comcastbusiness.net [173.11.38.132]) by johnspc.frickson.pvt (Postfix) with ESMTP id C78F82861F1F; Fri, 6 Jun 2014 07:55:06 -0500 (CDT) Message-ID: <1402059306.8234.34.camel@server.frickson.pvt> Subject: Re: SQLBulkOperations From: "John C. Frickson" To: "Inoue, Hiroshi" Cc: Michael Paquier , PostgreSQL ODBC List Date: Fri, 06 Jun 2014 07:55:06 -0500 In-Reply-To: <5391B076.8070208@tpf.co.jp> References: <1402025533.8234.13.camel@server.frickson.pvt> <1402055839.8234.18.camel@server.frickson.pvt> <5391B076.8070208@tpf.co.jp> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -0.9 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-odbc Precedence: bulk Sender: pgsql-odbc-owner@postgresql.org /etc/unixODBC/odbcinst.ini: [PSQL] Description = PostgreSQL Driver64 = /usr/lib64/psqlodbcw.so UsageCount = 1 I set attributes like this: SQLSetEnvAttr(henv, SQL_ATTR_ODBC_VERSION, (SQLPOINTER)SQL_OV_ODBC3, 0); SQLSetConnectAttr(hdbc,SQL_ATTR_ODBC_CURSORS,(SQLPOINTER)SQL_CUR_USE_ODBC,0); SQLSetStmtAttr(hstmt,SQL_ATTR_CONCURRENCY, SQL_CONCUR_ROWVER, 0); SQLSetStmtAttr(hstmt,SQL_ATTR_CURSOR_TYPE,SQL_CURSOR_KEYSET_DRIVEN,0); Connection is DSN-less using connection string: DRIVER={PGSQL};SERVER=xx.xxx.xx.x;UID=user;PWD=pass;DATABASE=MyDB;UseServerSidePrepare=1; I'm doing a read on a record and binding the columns. If found, update some columns and call SQLSetPos(hstmt, 1, SQL_UPDATE, SQL_LOCK_NO_CHANGE) to do the update, which works fine. If the record is not found, I set the values of all bound columns, then call SQLBulkOperations(hstmt, SQL_ADD) at which point I get the error. The SQLSetPos for update had been failing until I changed the concurrency to SQL_CONCUR_ROWVER and type to SQL_CURSOR_KEYSET_DRIVEN. I'm not sure what you mean about setting "option=1"?? On Fri, 2014-06-06 at 21:13 +0900, Inoue, Hiroshi wrote: > How are you setting UpdatableCursors option? > You have to set the option=1 when you use SQLBulkOperations(). > > regards, > Hiroshi Inoue > > (2014/06/06 20:57), John C. Frickson wrote: > > On Fri, 2014-06-06 at 13:37 +0900, Michael Paquier wrote: > >> On Fri, Jun 6, 2014 at 12:32 PM, John C. Frickson wrote: > >>> Is there a problem with the SQLBulkOperations function? When I call > >>> SQLBulkOperations(hstmt, SQL_ADD) I get an error: "[IM001] Driver does > >>> not support this function". > >>> > >>> I'm probably missing something simple. Help please? > >> What is the version of Postgres ODBC and ODBC lib used? the OS? I am > >> seeing in the code that SQLBulkOperations is used if odbc version > >> protocol is newer than 0x0300. > > > > Versions: > > > > OpenSUSE 13.1 x86_64 > > PostgreSQL 9.2.7 > > psqlODBC 08.03.0200 > > unixODBC 2.3.1 -- Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc