Thread: function parameters/output values

function parameters/output values

From
"Thomas Leavitt"
Date:
I would like to know if function parameters are used to pass output values
back to the function.

e.g.

create function func1(p1 varchar,p2 varchar OUTPUT, p3 varchar OUTPUT)
BEGINSELECT p1 = t.foo1, p3 = t.foo2FROM test_table tWHERE foo3 = p1
END

DECLARE p2 varchar(50), p3 varchar(50)
CALL func1('abc',@p2 out,@p3 out)
PRINT @p2
PRINT @p3
--
Thomas Leavitt -- thomas.leavitt@clickrebates.com; 408-591-3342
Co-Founder/COO, ClickRebates.Com, Inc. (www.clickrebates.com)
Get Paid What You're Worth!

Sign up for our pre-launch guest list and refer your friends!

Or use our working prototype at www.clickrebates.org to "Surf for a Higher
Cause" (earn money for charity)



Re: [SQL] function parameters/output values

From
Peter Eisentraut
Date:
Chapter 4 of the programmer's guide.

On 2000-01-12, Thomas Leavitt mentioned:

> I would like to know if function parameters are used to pass output values
> back to the function.
> 
> e.g.
> 
> create function func1(p1 varchar,p2 varchar OUTPUT, p3 varchar OUTPUT)
> BEGIN
>     SELECT p1 = t.foo1, p3 = t.foo2
>     FROM test_table t
>     WHERE foo3 = p1
> END
> 
> DECLARE p2 varchar(50), p3 varchar(50)
> CALL func1('abc',@p2 out,@p3 out)
> PRINT @p2
> PRINT @p3
> --
> Thomas Leavitt -- thomas.leavitt@clickrebates.com; 408-591-3342
> Co-Founder/COO, ClickRebates.Com, Inc. (www.clickrebates.com)
> Get Paid What You're Worth!
> 
> Sign up for our pre-launch guest list and refer your friends!
> 
> Or use our working prototype at www.clickrebates.org to "Surf for a Higher
> Cause" (earn money for charity)
> 
> 
> ************
> 
> 

-- 
Peter Eisentraut                  Sernanders väg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden




RE: [SQL] function parameters/output values

From
"Thomas Leavitt"
Date:
Peter,

Thanks for responding!

We looked at Chapter 4, and could not conclusively determine whether this
was the case. Can you point us to a specific page, paragraph, etc.? Can you
point us to some code examples (outside of the documentation)?

(Why isn't this in the FAQ... seems to be a very common question... and yet
almost impossible to conclusively determine by searching through the mailing
lists or documentation...)

Thomas

--
Thomas Leavitt -- thomas.leavitt@clickrebates.com; 408-591-3342
Co-Founder/COO, ClickRebates.Com, Inc. (www.clickrebates.com)
Get Paid What You're Worth!

Sign up for our pre-launch guest list and refer your friends!

Or use our working prototype at www.clickrebates.org to "Surf for a Higher
Cause" (earn money for charity)


> -----Original Message-----
> From: owner-pgsql-sql@postgreSQL.org
> [mailto:owner-pgsql-sql@postgreSQL.org]On Behalf Of Peter Eisentraut
> Sent: Wednesday, January 12, 2000 3:30 PM
> To: Thomas Leavitt
> Cc: pgsql-sql@postgreSQL.org
> Subject: Re: [SQL] function parameters/output values
>
>
> Chapter 4 of the programmer's guide.
>
> On 2000-01-12, Thomas Leavitt mentioned:
>
> > I would like to know if function parameters are used to pass
> output values
> > back to the function.
> >
> > e.g.
> >
> > create function func1(p1 varchar,p2 varchar OUTPUT, p3 varchar OUTPUT)
> > BEGIN
> >     SELECT p1 = t.foo1, p3 = t.foo2
> >     FROM test_table t
> >     WHERE foo3 = p1
> > END
> >
> > DECLARE p2 varchar(50), p3 varchar(50)
> > CALL func1('abc',@p2 out,@p3 out)
> > PRINT @p2
> > PRINT @p3
> > --
> > Thomas Leavitt -- thomas.leavitt@clickrebates.com; 408-591-3342
> > Co-Founder/COO, ClickRebates.Com, Inc. (www.clickrebates.com)
> > Get Paid What You're Worth!
> >
> > Sign up for our pre-launch guest list and refer your friends!
> >
> > Or use our working prototype at www.clickrebates.org to "Surf
> for a Higher
> > Cause" (earn money for charity)
> >
> >
> > ************
> >
> >
>
> --
> Peter Eisentraut                  Sernanders väg 10:115
> peter_e@gmx.net                   75262 Uppsala
> http://yi.org/peter-e/            Sweden
>
>
>
> ************
>
>