Thread: PLpgSQL variables persistance between several functions calls

PLpgSQL variables persistance between several functions calls

From
"Charles N. Charotti"
Date:
Hello everybody !

I want to know if I could share PLpgSQL variables between different functions and within different calls just using memory (not tables or other methods).

If it is really possible ?

Thanks in advance,

Chuck

Re: PLpgSQL variables persistance between several functions calls

From
Pavel Stehule
Date:
Hello

no, it's not possible

Regards

Pavel Stehule

2011/5/2 Charles N. Charotti <ccharotti@yahoo.com>:
> Hello everybody !
>
> I want to know if I could share PLpgSQL variables between different
> functions and within different calls just using memory (not tables or other
> methods).
>
> If it is really possible ?
>
> Thanks in advance,
>
> Chuck
>

Re: PLpgSQL variables persistance between several functions calls

From
Willy-Bas Loos
Date:
Hi,
Maybe calling a function from within another function would be a solution to you.

Cheers,

WBL

On Tue, May 3, 2011 at 4:10 AM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
Hello

no, it's not possible

Regards

Pavel Stehule

2011/5/2 Charles N. Charotti <ccharotti@yahoo.com>:
> Hello everybody !
>
> I want to know if I could share PLpgSQL variables between different
> functions and within different calls just using memory (not tables or other
> methods).
>
> If it is really possible ?
>
> Thanks in advance,
>
> Chuck
>

--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql



--
"Patriotism is the conviction that your country is superior to all others because you were born in it." -- George Bernard Shaw

Re: PLpgSQL variables persistance between several functions calls

From
Viktor Bojović
Date:
the best way is to put all calls into one function and store values to variables..

if that is not suitable you can try the way (which im not sure if anyone uses) and it is to store values to sequences if value type is integer.
for other formats you will have to do conversions.
but im not sure if sequence values are stored in database or in memory.
that way will make your results visible to all sessions.


On Mon, May 2, 2011 at 11:43 PM, Charles N. Charotti <ccharotti@yahoo.com> wrote:
Hello everybody !

I want to know if I could share PLpgSQL variables between different functions and within different calls just using memory (not tables or other methods).

If it is really possible ?

Thanks in advance,

Chuck



--
---------------------------------------
Viktor Bojović
---------------------------------------
Wherever I go, Murphy goes with me