Stepping through cursors

From: "Oleg Lebedev" <oleg(dot)lebedev(at)waterford(dot)org>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Stepping through cursors
Date: 2002-09-05 23:20:37
Message-ID: 993DBE5B4D02194382EC8DF8554A52730334E9@postoffice.waterford.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I opened a cursor and trying to step through it. The problem I came
across is how to check whether the end of the cursor have been reached,
smth like "if (rec%NOTFOUND)" in Oracle. Any ideas how to do this
gracefully without running an sql query to find out the size of the
cursor record set?
BTW, is there any other way to step through records returned by a
dynamic query. For example, suppose I have a query "select col_name from
table_name", where col_name and table_name are passed as a parameter to
a procedure. I want to step through the result of this query and put all
values in the column in a coma-separated array.
Thanks.

Oleg

Browse pgsql-general by date

  From Date Subject
Next Message Glen Parker 2002-09-06 01:17:00 Screwy Statistics...
Previous Message Nigel J. Andrews 2002-09-05 23:07:03 Re: Surprise :-(