Hello Willem, if its not too much data you could do an select * from table an store the result in an array of rows. Then you can iterate over it.
If this is too bloated then create a cursor with: declare <cursorname> .... (refer to http://www.postgresql.org/docs/8.1/interactive/sql-declare.html ). Then use fetch to get the desired row. After you are finished use CLOSE to close it. With kind regards Florian Reiser -- http://www.ra-bc.de RA Unternehmensberatung Führen durch präzise Daten "WillemF" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] >I am a novice to SQL. Hope my naiivity does not show so clearly. After > consulting the Internet extensively and studying the two thick > reference books that I have, I cannot find an answer to my problem, > which I suspect has no immediate solution. I need to move through a > table and extract the records sequentially one by one and display the > contents on screen. The order of the records is never changed. I can > easily create an index and find a record with an instructuion such as > SELECT * FROM tablename WHILE record_id = 20 , or some similar way. > But if I need to progress to the next record this is an extremely > inefficient way to do it since one has to serach the whole database > just to get to the next record. It would be much easier to have a > pointer to each of the records in the table and use these pointers to > directly jump to the appropriate record. In the old days of DBase there > was an instruction such as GOTO recordnumber. That would set the > pointer to the appropriate record which could then be accessed. With > PgSQL being so much more sophisticated than DBase, I am convinced there > must be an elegant way of solving this problem. Kind regards. > ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org