pg.ddx.io pgsql-odbc@postgresql.org mailing list archive
help / color / mirror / Atom feedCannot update or delete rows
2+ messages / 2 participants
[nested] [flat]
* Cannot update or delete rows
@ 2006-07-28 12:02 Pascal Viandier <pascal@accovia.com>
2006-07-31 04:05 ` Re: Cannot update or delete rows Ludek Finstrle <luf@pzkagis.cz>
0 siblings, 1 reply; 2+ messages in thread
From: Pascal Viandier @ 2006-07-28 12:02 UTC (permalink / raw)
To: 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
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Cannot update or delete rows
2006-07-28 12:02 Cannot update or delete rows Pascal Viandier <pascal@accovia.com>
@ 2006-07-31 04:05 ` Ludek Finstrle <luf@pzkagis.cz>
0 siblings, 0 replies; 2+ messages in thread
From: Ludek Finstrle @ 2006-07-31 04:05 UTC (permalink / raw)
To: Pascal Viandier <pascal@accovia.com>; +Cc: pgsql-odbc
> I use PostgreSQL 8.1.4 and psqlodbc-08.01.0200.
I'm sorry but psqlodbc-08.01.XXXX doesn't support such feature
(updateable cursor). I know there is no info about it. But 08.01
uses libpq for communication with server and there are some
breakage in updateable code.
Please try latest CVS from pgfoundry.org. It should do what you want.
I see two posts from you I hope it's enough to respond to on of them
only.
Regards,
Luf
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2006-07-31 04:05 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-07-28 12:02 Cannot update or delete rows Pascal Viandier <pascal@accovia.com>
2006-07-31 04:05 ` Ludek Finstrle <luf@pzkagis.cz>
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