Re: Need help with INOUT mis-understanding

From: "Troy" <troy(at)hendrix(dot)biz>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Need help with INOUT mis-understanding
Date: 2005-10-27 03:13:07
Message-ID: 1130382787.735878.10270@g47g2000cwa.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom's right, As in the first message of this thread kindof shows;
func2(INOUT) adds the var_1 to itself and ouputs back to func1 as the
updated value.
NOTICE: var_1 starts as 5
NOTICE: var_1 in func2 is 10
CONTEXT: PL/pgSQL function "func1" line 7 at assignment
NOTICE: var_X Now is (10,5) --var_1 was 1st returned var

So INOUTS "work" the way Tom says in PG8.1beta3 WIN XP
The part I was confused about was that I thought that the value would
then be modified in func1 (by func2) since it was returned using INOUT
but Tom set me strait - INOUTS are nice 'shorthand'. (I waisted a lot
of time not knowing this.)
Thanks

P.S. - Tom if the return of func2 = var_X = (10,5) how can I parse the
varible out like:
var_Y = var_X[1] -- first ARRAY item
to get var_Y = 10?

Troy H

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Fuhr 2005-10-27 04:05:22 Re: Seq Scan but I think it should be Index Scan
Previous Message Bruce Momjian 2005-10-27 02:56:32 Re: Win32 libpq and ecpg thread safety