Re: Cursor Issue?? - Mailing list pgsql-general

From Roman Neuhauser
Subject Re: Cursor Issue??
Date
Msg-id 20050727143551.GD41332@isis.sigpipe.cz
Whole thread Raw
In response to Cursor Issue??  ("DracKewl" <bradbudge@hotmail.com>)
Responses Re: Cursor Issue??
List 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 by date:

Previous
From: Roman Neuhauser
Date:
Subject: Re: Daily digest?
Next
From: Roman Neuhauser
Date:
Subject: Re: About Tools at the DB design phase.