Re: replacing single quotes - Mailing list pgsql-general

From Albe Laurenz
Subject Re: replacing single quotes
Date
Msg-id D960CB61B694CF459DCFB4B0128514C25686D0@exadv11.host.magwien.gv.at
Whole thread Raw
In response to Re: replacing single quotes  (Ow Mun Heng <Ow.Mun.Heng@wdc.com>)
List pgsql-general
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

pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: ORDER BY - problem with NULL values
Next
From: "Albe Laurenz"
Date:
Subject: Re: Upper and Lower-cased Database names?