Re: plpgsql out parameter with select into

From: Sergey Konoplev <gray(dot)ru(at)gmail(dot)com>
To: Horváth Imre <horvath(dot)imre(at)blemidon(dot)hu>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: plpgsql out parameter with select into
Date: 2010-08-18 05:42:52
Message-ID: AANLkTi=YT1cYTeu0JbN_0ZYBjN-jyrA6fpRDuQcX95xN@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

SELECT column_name
INTO var_name
FROM ...

2010/8/17 Horváth Imre <horvath(dot)imre(at)blemidon(dot)hu>:
> Hi!
>
> My question is, how can I get the out parameter from a function with
> SELECT INTO by name?
> I mean:
>
> create function testfunc1(OUT _status integer) returns integer as
> $BODY$
>        _status := 0;
> $BODY$
> language plpgsql;
>
> create function testfunc2() as
> declare
>        status integer;
> $BODY$
>        select into status * from testfunc1();
> $BODY$
> language plpgsql;
>
> create function testfunc3() as
> declare
>        status integer;
> $BODY$
>        select into status _status from testfunc1();
> $BODY$
> language plpgsql;
>
> testfunc2 works, testfunc3 not.
>
> Thanks in advance:
> Imre Horvath
>
>
> --
> Sent via pgsql-sql mailing list (pgsql-sql(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql
>

--
Sergey Konoplev

Blog: http://gray-hemp.blogspot.com /
Linkedin: http://ru.linkedin.com/in/grayhemp /
JID/GTalk: gray(dot)ru(at)gmail(dot)com / Skype: gray-hemp / ICQ: 29353802

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Sergey Konoplev 2010-08-18 05:51:27 Re: Question about POSIX Regular Expressions performance on large dataset.
Previous Message Pavel Stehule 2010-08-18 04:39:37 Re: plpgsql out parameter with select into