Search Postgresql Archives

out parameter and setof record

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

 



In PostgreSql 8.1 i've tried to use Out parameter but when I've changed
function (added Out parameter)

------------------------------------

CREATE OR REPLACE FUNCTION reffunc3(FROM_ID in integer,COUNT_ROW OUT
integer) RETURNS SETOF Person AS '
DECLARE
   rec RECORD;
BEGIN

   SELECT count(*) INTO COUNT_ROW FROM Person WHERE ssn>FROM_ID ;

   FOR rec IN SELECT ssn,name  FROM Person WHERE ssn>FROM_ID
     LOOP
       c;RETURN NEXT rec ;
     END LOOP ;

   RETURN ;
END;
' LANGUAGE plpgsql;



--SELECT * from reffunc3(1) ;
----------------------------------------

i've seen :

----
ERROR:  function result type must be integer because of OUT parameters
----

Of course when I change parameter to Integer it must be Record error
appears.

What should I change, and how to call this function?

Mirek



[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