Re: Cursor Issue??

Поиск
Список
Период
Сортировка
От Roman Neuhauser
Тема Re: Cursor Issue??
Дата
Msg-id 20050727143551.GD41332@isis.sigpipe.cz
обсуждение исходный текст
Ответ на Cursor Issue??  ("DracKewl" <bradbudge@hotmail.com>)
Ответы Re: Cursor Issue??  ("DracKewl" <bradbudge@hotmail.com>)
Список pgsql-general
# bradbudge@hotmail.com / 2005-07-26 14:06:34 -0700:
> BEGIN WORK;
> DECLARE cursor1 CURSOR FOR SELECT * FROM PARTS;
> FETCH FIRST FROM cursor1;
> CLOSE cursor1;
> COMMIT WORK;
>
> ------------------------
> Query result with 1 rows discarded.
> Query returned successfully with no result in 31 ms.
>
> In the "data output" view nothing is returned?

    Complain to your '"data output" view' vendor.

    test=# create table parts (id serial, t text);
    CREATE TABLE
    test=# insert into parts (t) values ('aaa');
    INSERT 72423 1
    test=# insert into parts (t) values ('bbb');
    INSERT 72424 1
    test=# insert into parts (t) values ('ccc');
    INSERT 72425 1
    test=# select * from parts;
     id |  t
    ----+-----
      1 | aaa
      2 | bbb
      3 | ccc
    (3 rows)

    test=# BEGIN WORK;
    BEGIN
    test=# DECLARE cursor1 CURSOR FOR SELECT * FROM PARTS;
    DECLARE CURSOR
    test=# FETCH FIRST FROM cursor1;
     id |  t
    ----+-----
      1 | aaa
    (1 row)

    test=# CLOSE cursor1;
    CLOSE CURSOR
    test=# COMMIT WORK;
    COMMIT
    test=#

    As you can see, the fetched row is displayed just fine.

--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE.             http://bash.org/?255991

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

Предыдущее
От: Roman Neuhauser
Дата:
Сообщение: Re: Daily digest?
Следующее
От: Roman Neuhauser
Дата:
Сообщение: Re: About Tools at the DB design phase.