Re: [GENERAL] Need help with INOUT mis-understanding

2005-10-27 Thread Tom Lane
"Troy" <[EMAIL PROTECTED]> writes: > 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? Try assigning the function result to a RECORD variable, perhaps SELECT * INTO rec FROM foo(...); The

Re: [GENERAL] Need help with INOUT mis-understanding

2005-10-27 Thread Troy
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,

Re: [GENERAL] Need help with INOUT mis-understanding

2005-10-27 Thread Troy
> Probably not, if the way you seem to expect it to work is like Oracle. > An INOUT parameter isn't some sort of modifiable by-reference variable, > it's just a shorthand for declaring an IN parameter and an OUT > parameter. > Thanks for the response. That makes a lot of sense but I guess I was w

Re: [GENERAL] Need help with INOUT mis-understanding

2005-10-26 Thread Tom Lane
Tony Caduto <[EMAIL PROTECTED]> writes: > So what you are saying is INOUT params are NOT constants and you can > modify them in the function body? If you couldn't modify them, there would be no way to return a new value (ie, anything but the passed-in value), so it'd be pretty broken IMHO ...

Re: [GENERAL] Need help with INOUT mis-understanding

2005-10-26 Thread Tony Caduto
Tom Lane wrote: Tony Caduto <[EMAIL PROTECTED]> writes: I have noticed this as well, if I declare OUT params I can modify them to my hearts content before they go out, however if you declare it as a INOUT you can't modify it because it is declared as a constant. Uh, I don't think so.

Re: [GENERAL] Need help with INOUT mis-understanding

2005-10-26 Thread Tom Lane
Tony Caduto <[EMAIL PROTECTED]> writes: > I have noticed this as well, if I declare OUT params I can modify them > to my hearts content before they go out, > however if you declare it as a INOUT you can't modify it because it is > declared as a constant. Uh, I don't think so.

Re: [GENERAL] Need help with INOUT mis-understanding

2005-10-26 Thread Tony Caduto
Tom Lane wrote: "Troy" <[EMAIL PROTECTED]> writes: Does PL/PGSQL handle INOUTS the same as ORACLE PL/SQL? Probably not, if the way you seem to expect it to work is like Oracle. An INOUT parameter isn't some sort of modifiable by-reference variable, it's just a shorthand for declaring

Re: [GENERAL] Need help with INOUT mis-understanding

2005-10-26 Thread Tom Lane
"Troy" <[EMAIL PROTECTED]> writes: > Does PL/PGSQL handle > INOUTS the same as ORACLE PL/SQL? Probably not, if the way you seem to expect it to work is like Oracle. An INOUT parameter isn't some sort of modifiable by-reference variable, it's just a shorthand for declaring an IN parameter and an OU

[GENERAL] Need help with INOUT mis-understanding

2005-10-26 Thread Troy
Yes, I'm a Newbie but I really like it so far except a few misunderstandings I have, like INOUT. (I am using 8.1 beta 3 on both WIN and FC w/ pgadmin III.) I cannot use multiple in/out/inouts within functions to return results. How can I use INOUTS the right way? Here I thought I'd get an updated