Cannot update or delete rows

From: "Pascal Viandier" <pascal(at)accovia(dot)com>
To: <pgsql-odbc(at)postgresql(dot)org>
Subject: Cannot update or delete rows
Date: 2006-07-28 12:02:17
Message-ID: 00f401c6b23d$ac4b8f20$270210ac@windows.accovia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

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.

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=1 in odbc.ini

Here is the odbc.ini part for pgodbc:

[lt]
Driver=/home/pascal/ODBC/libpsqlodbcw.so
Description=PostgreSQL ODBC DRIVER
ServerName=mbench
Database=lt
Port=5432
UserName=postgres
Password=postgres
ReadOnly=0
RowVersioning=1
ShowSystemTables=0
ShowOidColumn=1
FakeOidIndex=0
UpdatableCursors=1
UseDeclareFetch=1
CommLog=1
Debug=1
Trace=Yes
TraceFile=/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

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message vivek 2006-07-28 15:18:58
Previous Message noreply 2006-07-28 07:23:46 [ psqlodbc-Bugs-1000692 ] Broken UTF-8 support in Version 08.02.0002