[Q] Scrollable cursor with PostgresV2 / current Glorp version
yanni at rogers.com
Tue Nov 14 20:05:40 UTC 2006
Franz Josef wrote:
> 1) Scrollable cursors
> I've fiddled with scrollable cursors using the current PostgresV2 libary
> for squeak. But I've found no code that implemented that feature. Is
> everybody always loading the whole result set or did I oversee
> something? Is there some high level code available that uses the cursor
> handling of PostgreSQL?
I don't remember ever trying to use the CURSOR feature,
but from reading, it should just work. So, I just tried
it by finding an example at:
and modifying it slightly. In the code snippet below, "self"
refers to an already connected PGConnection I have in an
inspector. Then I ran doIt/inspectIt on the various lines.
The FETCH result was just what I expected - 5 more lines
of the result, each time I ran it.
self execute: 'BEGIN WORK'
self execute: 'DECLARE liahona SCROLL CURSOR FOR SELECT * FROM
self execute: 'FETCH FORWARD 5 FROM liahona'
self execute: 'FETCH PRIOR FROM liahona'
self execute: 'CLOSE liahona'
self execute: 'COMMIT WORK'
If that's not the feature you're looking for,
then please explain further. Also, you might
want to look at this thread from the Seaside
More information about the Squeak-dev