Skip site navigation (1) Skip section navigation (2)

Re: Easy way to call a plpgsql function?

From: Ken Corey <ken(at)kencorey(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Easy way to call a plpgsql function?
Date: 2001-02-06 08:06:41
Message-ID: 0102060806410N.18716@kenlinux.bithub.org (view raw or flat)
Thread:
Lists: 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.

In response to

pgsql-novice by date

Next:From: benoit.le-dizes@voila.frDate: 2001-02-06 13:06:38
Subject: installation
Previous:From: Ken CoreyDate: 2001-02-06 07:56:57
Subject: Easy way to call a plpgsql function?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group