> > Then I've tried: > > CREATE FUNCTION foo(insklid int, out sklid int, out elid INT) RETURNS SETOF > record AS $$ > BEGIN > RETURN QUERY SELECT sklid,elid FROM skladkol; > RETURN; > END; > $$ LANGUAGE plpgsql;
know bug :( - your variable names are in collision with column names. You have to protect self - use prefixes for variables postgres=# create table a(a varchar, b int); CREATE TABLE postgres=# insert into a values('kuku',10),('juku',20); INSERT 0 2 postgres=# create function f(out _a varchar, out _b integer) returns setof record as $$begin return query select * from a; return; end; $$ language plpgsql; CREATE FUNCTION postgres=# select * from f(); _a | _b ------+---- kuku | 10 juku | 20 (2 rows) regards Pavel Stehule > > but it returns 5498 rows (which is exact number of rows in that table) but > of NULL values. WHAT AM I DOING WRONG ? :((( > > I'm using EMS Manager 2007 Lite for PostgreSQL. That shouldn't be a problem, > right ? > > Regards, > > Milan Oparnica > > -- > Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-sql > -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql