X-Original-To: pgsql-odbc-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id C11799FA5DC for ; Thu, 27 Jul 2006 17:20:02 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 51081-04 for ; Thu, 27 Jul 2006 17:19:43 -0300 (ADT) X-Greylist: delayed 00:27:14.24907 by SQLgrey- Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 06E6B9FB21B for ; Thu, 27 Jul 2006 17:19:43 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from trojan.accovia.com (st-pierre2.accovia.com [204.19.176.29]) by svr4.postgresql.org (Postfix) with ESMTP id C931D5AF042 for ; Thu, 27 Jul 2006 19:52:26 +0000 (GMT) Received: from localhost (unknown [127.0.0.1]) by trojan.accovia.com (Postfix) with ESMTP id 4201228654 for ; Thu, 27 Jul 2006 15:52:00 -0400 (EDT) Received: from trojan.accovia.com ([127.0.0.1]) by localhost (trojan.accovia.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 14580-10 for ; Thu, 27 Jul 2006 15:51:59 -0400 (EDT) Received: from ddell038 (ddell038.windows.accovia.com [172.16.2.39]) by trojan.accovia.com (Postfix) with ESMTP id B1F2D28653 for ; Thu, 27 Jul 2006 15:51:59 -0400 (EDT) From: "Pascal Viandier" To: Subject: Problems updating rows Date: Thu, 27 Jul 2006 15:53:32 -0400 Organization: accovia Message-ID: <00f001c6b1b6$5713fdd0$270210ac@windows.accovia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.6626 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Importance: Normal X-Virus-Scanned: amavisd-new at accovia.com X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200607/48 X-Sequence-Number: 7959 Hi, I am modifying existing programs that were bound to Informix to use = ODBC. All this under SUN Solaris. I use unixODBC and setup 3 databases to connect to through ODBC: - Informix ODBC (CLI) - MySQL - PostgreSQL. I have a test program that makes various ODBC calls (Connect, Select, = Insert, Update, Delete) to these databases. This program works well with the two = others. I use PostgreSQL 8.1.4 and psqlodbc-08.01.0200. My problem with the PostgreSQL ODBC is: I cannot Update or Delete rows = using SQLSetPos(). I have seen many threads on this subject in this newsgroup but I cannot = figure out what to do to have it work. First, I re-created the database with oids since they look essential in = this case. Then I put UpdatableCursors=3D1 in odbc.ini, as seen in other threads Here is the odbc.ini part for pgodbc: [lt] Driver=3D/home/pascal/ODBC/libpsqlodbcw.so Description=3DPostgreSQL ODBC DRIVER ServerName=3Dmbench Database=3Dlt Port=3D5432 UserName=3Dpostgres Password=3Dpostgres ReadOnly=3D0 RowVersioning=3D1 ShowSystemTables=3D0 ShowOidColumn=3D1 FakeOidIndex=3D0 UpdatableCursors=3D1 UseDeclareFetch=3D1 CommLog=3D1 Debug=3D1 Trace=3DYes TraceFile=3D/tmp/pgsql.log The main problem is I cannot change the cursor type of the SELECT = statement. When calling SQLSetStmtAttr(hstmt, SQL_ATTR_CURSOR_TYPE, (SQLPOINTER) SQL_CURSOR_KEYSET_DRIVEN, 0); as seen in an other thread, I get a return = code of SQL_SUCCESS_WITH_INFO and SQLDiagRec returns: SQLSTATE:01S02 NATIVE CODE: 16 MESSAGE: Requested value changed. If I call SQLGetStmtAttr(..., SQL_ATTR_CURSOR_TYPE,...); it returns SQL_CURSOR_STATIC. I really think this is why I cannot update or delete rows using = SQLSetPos() but I don't know why I cannot change the cursor type. I have to say, I spent some hours reading this newsgroup to try finding = a solution but I am completely stuck now. Any help would be greatly appreciated. Thanks in advance. Pascal