Re: ECPG and Curors.

Поиск
Список
Период
Сортировка
От John Smith
Тема Re: ECPG and Curors.
Дата
Msg-id 00de01c68ec7$690d4030$1400a8c0@rose
обсуждение исходный текст
Ответ на Re: ECPG and Curors.  (Michael Meskes <meskes@postgresql.org>)
Список pgsql-general
On Mon, Jun 12, 2006 at 11:14:24PM -0400, Peter L. Berghold wrote:
> what I don't see is how to detect that I've fetched the last row from a
> query.   Is there more complete doco on this process somewhere?

You could either handle a NOT FOUND exception, or make use of SQLCODE or
SQLSTATE like this...


EXEC SQL DECLARE csr_fred CURSOR FOR SELECT....

EXEC SQL OPEN csr_fred;

while (SQLCODE == 0) {
    EXEC SQL FETCH csr_fred INTO :jim, :sheila,...

    if (SQLCODE == 0) {

        ....
        body of row processing here
        ....
    }
}

EXEC SQL CLOSE csr_fred;



В списке pgsql-general по дате отправления:

Предыдущее
От: "Pat Maddox"
Дата:
Сообщение: Re: Help speeding up this query - maybe need another index?
Следующее
От: jdwatson1@gmail.com
Дата:
Сообщение: BLOB & Searching