Ow Mun Heng wrote:
>>>>> Input is of form
>>>>>
>>>>> 'ppp','aaa','bbb'
>>>>>
>>>>> I want it to be stripped of quotes to become
>>>>>
>>>>> ppp,aaa,bbb
>>>
>>> The input is for an SRF which accepts an array..
>>>
>>> where the function goes..
>>> create function foo(timestamp, timestamp, foo_list text[])
>>> returns setof
>>> ...
I said:
>> In reality you will have varying values for the
>> foo_list function argument. So you'll store it in some
>> kind of variable, right?
>>
>> In which programming language do you write?
Answer:
> plpgsql
Ok, we're coming closer.
What I mean:
In which programming language is the *call* to
function foo()? Java? PHP? PL/pgSQL?
Could you tell me the exact statement that you use
to call foo()?
Why do I ask this? An example:
If you use embedded SQL to call the function, and the
input is stored in the host variable "inpstr", then the answer
would be:
EXEC SQL DECLARE c CURSOR FOR SELECT * FROM foo(localtimestamp,
localtimestamp, string_to_array(replace(:inpstr, '''''', ''), ','));
Yours,
Laurenz Albe