0

I am running PostgreSQL Version 9.3.4 on an Ubuntu 64 bit Server.

I am using the PoatgreSQL ODBC Driver (libpsqlodbcw) version 9.03 on HP-UX.

I am able to connect, retrieve data and do general sequel updates. However, when I attempt to update a cursor with SQLSetPOS, I get the error:

Only SQL_POSITION/REFRESH is supported for PGA PI_SetPos

I have attempted using the syntax select * from table for update of table (and many versions of this) and nothing has worked.

I am guessing, at this point, that such updates are not supported. Does any one have any input on this?

evraz001
  • 31
  • 2
  • 6
  • 1
    The server certainly supports updateable cursors. Whether psqlODBC does is a separate thing - try asking a new question specifically regarding psqlODBC, **showing your code**. – Craig Ringer May 13 '14 at 00:23

1 Answers1

1

YES, cursor can update.

digoal=# begin;
BEGIN
digoal=# declare cur cursor for select * from t;
DECLARE CURSOR
digoal=# fetch next from cur;
 id | phone | cnt 
----+-------+-----
  1 |     1 |   3
(1 row)

digoal=# update t set cnt=1000 where current of cur returning *;
 id | phone | cnt  
----+-------+------
  1 |     1 | 1000
(1 row)

UPDATE 1
digoal=# select * from t where id=1;
 id | phone | cnt  
----+-------+------
  1 |     1 | 1000
(1 row)

digoal=# end;
COMMIT
digoal=# select * from t where id=1;
 id | phone | cnt  
----+-------+------
  1 |     1 | 1000
(1 row)
digoal.zhou
  • 434
  • 2
  • 3