Re: Easy way to call a plpgsql function? - Mailing list pgsql-novice

From Ken Corey
Subject Re: Easy way to call a plpgsql function?
Date
Msg-id 0102060806410N.18716@kenlinux.bithub.org
Whole thread Raw
In response to Easy way to call a plpgsql function?  (Ken Corey <ken@kencorey.com>)
List 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 by date:

Previous
From: Ken Corey
Date:
Subject: Easy way to call a plpgsql function?
Next
From: "benoit.le-dizes@voila.fr"
Date:
Subject: installation