Re: replacing single quotes
От | Albe Laurenz |
---|---|
Тема | Re: replacing single quotes |
Дата | |
Msg-id | D960CB61B694CF459DCFB4B0128514C25686D0@exadv11.host.magwien.gv.at обсуждение исходный текст |
Ответ на | Re: replacing single quotes (Ow Mun Heng <Ow.Mun.Heng@wdc.com>) |
Список | 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 по дате отправления: