Re: INOUT PARAMETERS WITH RETURN TABLES IN FUNCTION

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: İlyas Derse <ilyasderse(at)gmail(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: INOUT PARAMETERS WITH RETURN TABLES IN FUNCTION
Date: 2019-11-08 15:25:09
Message-ID: f9d3d852-c03f-2d62-1eb8-0fd8692b9930@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 11/8/19 12:18 AM, İlyas Derse wrote:
> I'm trying to migration to PostgreSql from SQL Server.  I have Stored
> Procedures what have output parameters and return tables. How can i do
> both together.

Can you show an example of a SQL Server procedure that demonstrates what
you want to achieve?

>
> Its like ;
>
> CREATE or replace FUNCTION public."test" (INOUT "x" integer, INOUT "y"
> character varying(36))
>
> RETURNS TABLE  (
> "id" integer,
> "filesize" character varying(36)
> )
> AS $$
>  BEGIN
>   x=6;
> RETURN QUERY
> SELECT * FROM    public."tbl_employees" ;
>
> END;
> $$ LANGUAGE plpgsql;
>
> I can not create that because of inout parameters.
> Another place;
>
> do $$
> DECLARE b integer = 1;
> DECLARE d integer = 2 ;
> BEGIN
>   select * from public."test"();
> END;
> $$;
>
>  Anybody have an idea ?

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Zwettler Markus (OIZ) 2019-11-08 16:02:49 AW: AW: AW: AW: AW: broken backup trail in case of quickly patroni switchback and forth
Previous Message Brad Nicholson 2019-11-08 14:57:43 Re: AW: AW: AW: AW: broken backup trail in case of quickly patroni switchback and forth