Re: Function problem again... - Mailing list pgsql-novice

From Henshall, Stuart - Design & Print
Subject Re: Function problem again...
Date
Msg-id E2870D8CE1CCD311BAF50008C71EDE8E0506DC8E@MAIL_EXCHANGE
Whole thread Raw
In response to Function problem again...  (Mole <mole@zebra.co.uk>)
List pgsql-novice

Mole wrote:
> Hello,
> I hope this is a quick question, I want to create a function that
> will take a number of varchars as input .
> If it was a single varchar as input i know it would be
>
> CREATE FUNCTION "user_id_funct_p3" (varchar) RETURNS varchar AS '
>
> and if it is multiple I think it would be
>
> CREATE FUNCTION "user_id_funct_p3" (varchar varchar varchar) RETURNS
> varchar AS '
>
> however i the number of inputs are not going to be constant do I have
> to generate the function every time.. with the right number of inputs
> or is there a way to tell a function that the input will be setof
> varchar
>
> I hope I am making sense
>
> Thanks in advance
>
> Mole
>
There is no equivalent of varargs for function decalarations.
Also to specify multiple arguments you use commas:
CREATE FUNTION tst_func(text,text,text) .......
hth,
- Stuart

pgsql-novice by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: Populating a database
Next
From: "Henshall, Stuart - Design & Print"
Date:
Subject: Re: AutoIncrement not working on this table only