Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id C3F9EB5DBCD for ; Sun, 19 Jun 2011 06:49:52 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 66165-07 for ; Sun, 19 Jun 2011 09:49:46 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34]) by mail.postgresql.org (Postfix) with SMTP id 79255B5DBCC for ; Sun, 19 Jun 2011 06:49:44 -0300 (ADT) Received: (qmail 3644 invoked by uid 512); 19 Jun 2011 09:49:41 -0000 X-Authentication: inoue was authenticated by sd.tpf.co.jp at 19 Jun 2011 09:49:41 -0000 Received: from unknown (HELO ?192.168.24.54?) (183.76.23.68) by sd.tpf.co.jp with SMTP; 19 Jun 2011 09:49:41 -0000 Message-ID: <4DFDC62F.7050409@tpf.co.jp> Date: Sun, 19 Jun 2011 18:49:35 +0900 From: Hiroshi Inoue User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; ja; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: BGoebel CC: pgsql-odbc@postgresql.org Subject: Re: ERROR with "Update ... where Current of" References: <1308325870920-4499184.post@n5.nabble.com> In-Reply-To: <1308325870920-4499184.post@n5.nabble.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.88 tagged_above=-10 required=5 tests=BAYES_00=-1.9, DNS_FROM_RFC_BOGUSMX=1.668, T_RP_MATCHES_RCVD=-0.01, URI_HEX=1.122 X-Spam-Level: X-Archive-Number: 201106/15 X-Sequence-Number: 10673 Hi, Unfortunately the psqlodbc driver doesn't support POSITIONED UPDATE. regards, Hiroshi Inoue (2011/06/18 0:51), BGoebel wrote: > 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.