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 37EBD9FB25F for ; Fri, 28 Jul 2006 09:01:43 -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 35472-10 for ; Fri, 28 Jul 2006 09:01:27 -0300 (ADT) X-Greylist: delayed 16:08:49.383269 by SQLgrey- Received: from trojan.accovia.com (st-pierre2.accovia.com [204.19.176.29]) by postgresql.org (Postfix) with ESMTP id 737669FB21E for ; Fri, 28 Jul 2006 09:01:27 -0300 (ADT) Received: from localhost (unknown [127.0.0.1]) by trojan.accovia.com (Postfix) with ESMTP id EA905285A7 for ; Fri, 28 Jul 2006 08:01:20 -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 08837-07 for ; Fri, 28 Jul 2006 08:00:45 -0400 (EDT) Received: from ddell038 (ddell038.windows.accovia.com [172.16.2.39]) by trojan.accovia.com (Postfix) with ESMTP id C96C0285AB for ; Fri, 28 Jul 2006 08:00:44 -0400 (EDT) From: "Pascal Viandier" To: Subject: Cannot update or delete rows Date: Fri, 28 Jul 2006 08:02:17 -0400 Organization: accovia Message-ID: <00f401c6b23d$ac4b8f20$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/49 X-Sequence-Number: 7960 Hi, I am in the process of modifying existing programs closely bound to = Informix to make them use ODBC with unixODBC on SPARC Sun Solaris.=20 I setup 3 databases to connect to through ODBC: - Informix ODBC (CLI) - MySQL - PostgreSQL. I use a test program that makes various ODBC calls (Connect, Select, = Insert, Update, Delete...) on these databases. It works well with the first two = but not with PostgreSQL when it comes to update or delete rows in a table using SQLSetPos(). I use PostgreSQL 8.1.4 and psqlodbc-08.01.0200. I have seen many threads on this subject in this newsgroup but I cannot = figure out what to do to make it work. Using the information related to this problem from this newsgroup I = already made the following changes to my initial setup - with no success - : - re-created the database with oids since they seem to be essential in = this case. - put UpdatableCursors=3D1 in odbc.ini 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 My concern is I cannot change the type of the cursor 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 the = return code 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 think this is why I cannot update or delete rows using SQLSetPos() but = I do not understand why I cannot change the cursor type. I already spent many hours browsing this newsgroup to find a solution = but now I am completely stuck. Any help would be greatly appreciated. Thanks in advance. Pascal