From: | "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at> |
---|---|
To: | "Ow Mun Heng *EXTERN*" <Ow(dot)Mun(dot)Heng(at)wdc(dot)com> |
Cc: | <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: replacing single quotes |
Date: | 2007-10-10 11:18:51 |
Message-ID: | D960CB61B694CF459DCFB4B0128514C25686D0@exadv11.host.magwien.gv.at |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Albe Laurenz | 2007-10-10 11:20:27 | Re: Upper and Lower-cased Database names? |
Previous Message | vladimir konrad | 2007-10-10 10:35:07 | Re: Database reverse engineering |