Search Postgresql Archives

Re: returning parameters from function

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

 



On Tue, Dec 12, 2006 at 10:30:07AM +0100, Rikard Pavelic wrote:
> Hi!
>
> Is there any plan to add implicit declaration of returning parameters
> for functions?
> Something like:
> create function list(in a int) returns setof implicit record as

You can use a SETOF function as:

CREATE OR REPLACE FUNCTION get_test_data (numeric)
    RETURNS SETOF RECORD AS
$$
DECLARE
    temp_rec    RECORD;
BEGIN
    FOR temp_rec IN (SELECT ename FROM emp WHERE sal > $1)
    LOOP
        RETURN NEXT temp_rec;
    END LOOP;
    RETURN;
END;
$$ LANGUAGE plpgsql;

-----------------------
Shoaib Mir
EnterpriseDB (www.enterprisedb.com)



[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