I used pg_catalog.replace, it worked. Thanks for the help
On Tue, Nov 23, 2010 at 3:32 PM, Pavel Stehule wrote:
> Hello
>
> it working on my comp
>
> postgres=# select mystr, test_repl(mystr) replaced_strfrom str_table;
> mystr | replaced_str
> --
Hello
it working on my comp
postgres=# select mystr, test_repl(mystr) replaced_strfrom str_table;
mystr | replaced_str
---+--
This road is INDEFLY CLSD | This road is indefinitely closed
That is INDEFLY open
CREATE OR REPLACE FUNCTION test_repl(x character varying)
RETURNS character varying AS
$BODY$
DECLARE
ret_var varchar(4000);
a record;
begin
ret_var := x;
for a in select * from lookup
loop
ret_var := replace(ret_var,a.code,a.codeword);
end loop;
return ret_var;
END;
$BODY$
LANGUAGE 'plpgsql
Hello
please, can you send a source code of your function?
Regards
Pavel Stehule
2010/11/23 akp geek :
> Dear all -
> I am having trouble with replace function inside a function.
> If I do the same replace function outside it works fine, Following example
> clearly explains my
Dear all -
I am having trouble with replace function inside a function.
If I do the same replace function outside it works fine, Following example
clearly explains my problem. Can you please help?
create table str_table
( mystr varchar(1000));
insert into str_table values ( 'Thi
On 23 Jan 2007 13:05:41 -0800, slawosz <[EMAIL PROTECTED]> wrote:
Hello,
I have to relpace string
http://example.com/index.php?module=articles&id= to string /module/ in
whole column in table. How exacly use replace? I noob in postgres, I
think it could be quite easy.
Please, help
try replace co
Hello,
I have to relpace string
http://example.com/index.php?module=articles&id= to string /module/ in
whole column in table. How exacly use replace? I noob in postgres, I
think it could be quite easy.
Please, help
---(end of broadcast)---
TIP 5: do