Re: Easy way to call a plpgsql function?

Поиск
Список
Период
Сортировка
От Ken Corey
Тема Re: Easy way to call a plpgsql function?
Дата
Msg-id 0102060806410N.18716@kenlinux.bithub.org
обсуждение исходный текст
Ответ на Easy way to call a plpgsql function?  (Ken Corey <ken@kencorey.com>)
Список pgsql-novice
*sigh* If you look a tad more closely than I did, you'll see there's a syntax
error in the first example. Once fixed, the function seems to operate as
expected.

One shouldn't try to program before morning coffee, I guess... *smile*

-Ken

On Tuesday 06 February 2001  7:56 am, Ken Corey wrote:
> Hi All,
>
> I'm trying to call a plpgsql function:
> func(varchar(255).varchar(255).varchar(255).varchar(255).varchar(255).varch
>ar(255).varchar(255).varchar(255).varchar(255).varchar(255).varchar(255));
>
> With:
> GRE=# select IU_EMPLOYEE ('f','f','f','f'',f','f','f','f','f','f','f');
> ERROR:  Function 'iu_employee(unknown, unknown, unknown, unknown, unknown,
> unknown, unknown, unknown, unknown, unknown)' does not exist
>         Unable to identify a function that satisfies the given argument
> types You may need to add explicit typecasts
> GRE=#
>
> I thought maybe overloading causes this...so I cast all the arguments as
> varchars, and sure enough...
>
> GRE=# select IU_EMPLOYEE (cast('f' as varchar),cast('f' as
> varchar),cast('f' as varchar),cast('f' as varchar),cast('f' as
> varchar),cast('f' as
> varchar),cast('f' as varchar),cast('f' as varchar),cast('f' as
> varchar),cast('f' as varchar),cast('f' as varchar));
>  iu_employee
> -------------
>            1
> (1 row)
>
> GRE=#
>
> How can I tell plpgsql that an arg like 'f' means varchar (other than
> casting it for every sql function call)?

--
Ken Corey, CTO    Atomic Interactive, Ltd.

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

Предыдущее
От: Ken Corey
Дата:
Сообщение: Easy way to call a plpgsql function?
Следующее
От: "benoit.le-dizes@voila.fr"
Дата:
Сообщение: installation