pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: BGoebel <b.goebel@prisma-computer.de>
To: pgsql-odbc@postgresql.org
Subject: ERROR with "Update ... where Current of"
Date: Fri, 17 Jun 2011 08:51:10 -0700 (PDT)
Message-ID: <1308325870920-4499184.post@n5.nabble.com> (raw)

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.



view thread (4+ messages)  latest in thread

Message-ID: <1308325870920-4499184.post@n5.nabble.com>
Permalink:  ../1308325870920-4499184.post@n5.nabble.com/
Also on:    postgresql.org/message-id/1308325870920-4499184.post@n5.nabble.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: b.goebel@prisma-computer.de
  Subject: Re: ERROR with "Update ... where Current of"
  In-Reply-To: <1308325870920-4499184.post@n5.nabble.com>
  References: <1308325870920-4499184.post@n5.nabble.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox