Search Postgresql Archives

Re: converter pgplsql funcion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello
create or replace function clean_string(_p_dado varchar)returns varchar as $$declare  _v_clean_string varchar := _p_dado;  _c varchar;begin  for _c in select caracter from caracters loop    _v_clean_string := replace(_c_clean_string, _c);  end loop;  return _c;end;$$ language plpgsql immutable strict;
regardsPavel Stehule
p.s. look on translate function, maybe it should help
http://www.postgresql.org/docs/8.3/interactive/functions-string.html
regardsPavel Stehule
2008/11/21 paulo matadr <saddoness@xxxxxxxxxxxx>:> I work with oracle and have poor experience in pg/plsql.> anybody can  help me  with translate from   pl/sql in pg/plsql in code> below:>> CREATE OR REPLACE FUNCTION clean_string(p_dado varchar2) RETURN varchar2> IS>   v_clean_string varchar(4000);> BEGIN>     v_clean_string := p_dado;>      for r in (select caracter from caracteres) loop>           select replace(v_clean_string,r.caracter,'')>          into v_clean_string>          from dual;>     end loop;>     return v_clean_string;> END;> />> need funcion in pg/plsql> thanks for help>>> ________________________________> Veja quais são os assuntos do momento no Yahoo! + Buscados: Top 10 -> Celebridades - Música - Esportes
-- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)To make changes to your subscription:http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux