On 2/19/06, Michael Fuhr <mike@xxxxxxxx> wrote:
On Sat, Feb 18, 2006 at 04:48:55PM +0800, Jan Cruz wrote:
CREATE TABLE foo (id integer, t text);
INSERT INTO foo VALUES (1, 'one');
INSERT INTO foo VALUES (2, 'two');
Thanks for the correct syntaxing Mike.
BTW I also got something like this:
CREATE FUNCTION func2() RETURNS SETOF foo as $$
DECLARE
row foo;
BEGIN
SELECT INTO ROW * from FOO;
return next foo;
END;
$$ LANGUAGE plpgsql STABLE;
select * from func2();
It did return the 2 rows (all rows) when I first test it.
Then today I tried the same function and test it then it return only 1 row.
I wonder..........
BTW, I'm using PostgreSQL 8.1.3.