Search Postgresql Archives

Re: Cursor Issue??

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



# bradbudge@xxxxxxxxxxx / 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

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux