SQLSetPos with SQL_POSITION

From: tomas(at)nocrew(dot)org (Tomas =?iso-8859-1?q?Sk=E4re?=)
To: pgsql-odbc(at)postgresql(dot)org
Subject: SQLSetPos with SQL_POSITION
Date: 2003-11-08 10:50:49
Message-ID: 80he1fw2uu.fsf@junk.nocrew.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Steve Wampler 2003-11-08 15:48:26 Re: Help with hang on empty query (PG 7.3.2,
Previous Message Philippe Lang 2003-11-08 10:04:18 Re: Access, pass-through queries and isolation level