Stepping/Paging Through Rows

From: Dan Parker <danp(at)town(dot)ipswich(dot)ma(dot)us>
To: pgsql-sql(at)postgreSQL(dot)org
Subject: Stepping/Paging Through Rows
Date: 1999-02-22 21:06:06
Message-ID: Pine.LNX.3.96.990222153316.1844C-100000@mis1.town.ipswich.ma.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

I've just started learning PostgreSQL (and SQL in general, really,
although I do have some experience with a proprietary RDBMS) and have been
wondering how I can page through records in a table or view.

I learned about cursors and they solved part of the problem - I created a
form with Perl/Tk with buttons to move forward a row and backwards a
row and that seems to be fine.

There are a couple of features I would like to have that I can't figure
out how I'd implement. For example, lets say I want to add a new row to
the table. I press an 'Add' button, the form goes blank, and I key in all
of the information. I press an 'Update' button and behind the scenes
things whirl around and update the record in the database. No problem.
But let's say now I want to return the user back to the browsing form and
place them on the row they just entered (while still being able to "page"
through the rows with the forward and back buttons). I'm stuck. If I
create a new cursor, I'm back at the beginning of the table - there
doesn't seem to be a way to find a particular row and placing the
cursor there after creating the cursor.

Any help would be appreciated. (I'd love a link to a good online SQL
resource.)

Dan

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Dave Inskeep 1999-02-22 22:43:56 Re: [SQL] questions on features
Previous Message Mauricio Carvalho de Oliveira 1999-02-22 19:53:29 Problem with HAVING clause