Re: [GENERAL] Problem with replace function in postgres

2010-11-23 Thread akp geek
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 > --

Re: [GENERAL] Problem with replace function in postgres

2010-11-23 Thread Pavel Stehule
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

Re: [GENERAL] Problem with replace function in postgres

2010-11-23 Thread akp geek
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

Re: [GENERAL] Problem with replace function in postgres

2010-11-23 Thread Pavel Stehule
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

[GENERAL] Problem with replace function in postgres

2010-11-23 Thread 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 problem. Can you please help? create table str_table ( mystr varchar(1000)); insert into str_table values ( 'Thi

Re: [GENERAL] Problem with replace

2007-01-24 Thread Merlin Moncure
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

[GENERAL] Problem with replace

2007-01-24 Thread slawosz
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