Re: How to Declare Functions Containing OUT PArameters?

Поиск
Список
Период
Сортировка
От Joshua D. Drake
Тема Re: How to Declare Functions Containing OUT PArameters?
Дата
Msg-id 1279133491.22775.49.camel@jd-desktop.iso-8859-1.charter.com
обсуждение исходный текст
Ответ на How to Declare Functions Containing OUT PArameters?  (Bill Thoen <bthoen@gisnet.com>)
Список pgsql-general
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


В списке pgsql-general по дате отправления:

Предыдущее
От: Kenichiro Tanaka
Дата:
Сообщение: Re: about scape characters
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: PgWest 2010 Call for Papers!