Re: Cursor Issue??

From: Roman Neuhauser <neuhauser(at)sigpipe(dot)cz>
To: DracKewl <bradbudge(at)hotmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Cursor Issue??
Date: 2005-07-27 14:35:51
Message-ID: 20050727143551.GD41332@isis.sigpipe.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

# bradbudge(at)hotmail(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Roman Neuhauser 2005-07-27 14:38:23 Re: About Tools at the DB design phase.
Previous Message Roman Neuhauser 2005-07-27 14:26:02 Re: Daily digest?