SQLSetPos with SQL_POSITION - Mailing list pgsql-odbc

From tomas@nocrew.org (Tomas Skäre)
Subject SQLSetPos with SQL_POSITION
Date
Msg-id 80he1fw2uu.fsf@junk.nocrew.org
Whole thread Raw
Responses Re: SQLSetPos with SQL_POSITION
List pgsql-odbc
Hi,

I have a question that might be more generally about ODBC. As I've
understood it, the SQLSetPos function, when doing
UPDATE/REFRESH/DELETE uses the rownumber within the currently fetched
rowset, while POSITION sets the cursor on the row number on the whole
result set. Or am I wrong here? Does POSITION also work only within
the current rowset?

With pgsql-odbc I get a "Row out of range" error when trying to do
SQLSetPos with SQL_POSITION and a rownumber other than 1. The rowset
size is set to 1 (one).

If I have made a select, I want to make a function that will update
one or several rows in this selection. Is it correct ODBC that I have
to do an SQLFetchScroll first, to set the cursor on the row I want to
update, and then use SQLSetPos with SQL_UPDATE to do the update? From
reading MSDN ODBC API, I got the impression that I could do an
SQLSetPos with SQL_POSITION, instead of the SQLFetchScroll.

I've set the cursor type to keyset driven and concurrency to ROWVER,
and I've compiled the psqlodbc from CVS with odbcver=0x0300. I'm
pretty new to ODBC, so I'm not familiar with all kinds of cursors and
such that are best for me. Any help to enlighten me is appreciated.

Also, are there any more good documentation for the ODBC API than the
MSDN pages?


Greetings,

Tomas

pgsql-odbc by date:

Previous
From: "Philippe Lang"
Date:
Subject: Re: Access, pass-through queries and isolation level
Next
From: Steve Wampler
Date:
Subject: Re: Help with hang on empty query (PG 7.3.2,