Return Table in StoredProceure/Function

From: İlyas Derse <ilyasderse(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Return Table in StoredProceure/Function
Date: 2019-11-20 08:18:49
Message-ID: CALcdmyQc2szTJBWQvzBmizpKji+L_cGk9sw6dSpTZLeasR817A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

How can I return table in Stored Procedure ? I can do it in function but I
have inout parameters.So I can not create in function. What can I do this
case ?

I guess,It should be like for function :

CREATE or REPLACE FUNCTION public."test" (INOUT "x" integer, INOUT "y" text)

RETURNS TABLE ("id" integer,"filesize" character varying(36))AS $$
BEGINRETURN QUERYSELECT * FROM public."tbl_employees" ;
END;$$ LANGUAGE plpgsql;

Thanks.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message James (王旭) 2019-11-20 08:22:22 Re: How should I specify work_mem/max_worker_processes if I want to do big queries now and then?
Previous Message James (王旭) 2019-11-20 08:05:50 Re: How should I specify work_mem/max_worker_processes if I want to do big queries now and then?