Search Postgresql Archives

Re: How to Declare Functions Containing OUT PArameters?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2010-07-14 at 12:21 -0600, Bill Thoen wrote:
> I'm having some difficulty getting plpgsql to recognize a function with 
> a couple of OUT parameters. I'm either declaring the function 
> incorrectly, making the call to it in the wrong way or my program is 
> simply possessed by evil spirits. I'm using Postgres 8.1.5.

First, 8.1.x is EOL as of November. You need to upgrade.


> CREATE OR REPLACE FUNCTION main() RETURNS VOID AS $$
> DECLARE
>    str1 text;
>    str2 text;
>    num integer := 0;
>    fnum real := 0.0;
> BEGIN
>    str1 := 'One fish, two fish';
>    str2 := 'Shark fish, No fish';
>    SELECT fishy( str1, str2, num, fnum) ;


> /*  ERROR MESSAGE
> 
> psql:ex_out_fail.sql:28: ERROR:  function fishy(text, text, integer, 
> real) does not exist
> HINT:  No function matches the given name and argument types. You may 
> need to add explicit type casts.
> CONTEXT:  SQL statement "SELECT  fishy(  $1 ,  $2 ,  $3 ,  $4 )"
> PL/pgSQL function "main" line 9 at SQL statement
> 

You are passing four IN paramaters. The out paramaters are used in
return are they not?

Joshua D. Drake


-- 
PostgreSQL.org Major Contributor
Command Prompt, Inc: http://www.commandprompt.com/ - 509.416.6579
Consulting, Training, Support, Custom Development, Engineering


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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux