Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 74828B5DBCE for ; Fri, 17 Jun 2011 12:51:18 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 16126-01 for ; Fri, 17 Jun 2011 15:51:11 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sam.nabble.com (sam.nabble.com [216.139.236.26]) by mail.postgresql.org (Postfix) with ESMTP id D1771B5DBD6 for ; Fri, 17 Jun 2011 12:51:11 -0300 (ADT) Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1QXbKA-0001dY-U2 for pgsql-odbc@postgresql.org; Fri, 17 Jun 2011 08:51:10 -0700 Date: Fri, 17 Jun 2011 08:51:10 -0700 (PDT) From: BGoebel To: pgsql-odbc@postgresql.org Message-ID: <1308325870920-4499184.post@n5.nabble.com> Subject: ERROR with "Update ... where Current of" MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.778 tagged_above=-10 required=5 tests=BAYES_00=-1.9, URI_HEX=1.122 X-Spam-Level: X-Archive-Number: 201106/13 X-Sequence-Number: 10671 Hi, after a lot of studying i couldn't find out what's going wrong with my positioned update. Whatever i have tried: SQLGetDiagRec reports: Error: "Cursor C1 does not exists" Here is my Code (a simplified example from MS): ... SQLRETURN = SQLAllocHandle(SQL_HANDLE_STMT, hdbc, &hstmtSelect); SQLRETURN = SQLAllocHandle(SQL_HANDLE_STMT, hdbc, &hstmtUpdate); SQLRETURN = SQLSetCursorName(hstmtSelect, "C1", SQL_NTS); SQLRETURN = SQLExecDirect(hstmtSelect, "SELECT NAME, PHONE FROM CUSTOMERS",SQL_NTS); /* in the example, a SQLBindCol followed here ... */ SQLRETURN = SQLFetch(hstmtSelect); /* positioned update : set first customers phonenumber to empty */ SQLRETURN = SQLExecDirect(hstmtUpdate, "UPDATE EMPLOYEE SET PHONE=\"\" WHERE CURRENT OF C1",SQL_NTS); ...SQLRETURN is set to -1, SQLGetDiagRec reports Error: "Cursor >>C1<< does not exist" ... psqlodbc30a.dll ist directly linked. Here is what i have tried: - Reading, exploring, reading, ... - Select ... for Update - connection Parameter UpdatableCursors=1; - connection Parameter Autocommit off - connection Parameter UseDeclareFetch=1 - Select ... for Update - Select ... with hold - older odbc Driver 8.04 - explict BEGIN Any help would be greatly appreciated! -- View this message in context: http://postgresql.1045698.n5.nabble.com/ERROR-with-Update-where-Current-of-tp4499184p4499184.html Sent from the PostgreSQL - odbc mailing list archive at Nabble.com.