[firebase-br] Tirar Acentuação, caracter especial, ponto e virgula e colocar todos os texto em caixa alta

Prisma - GMAIL prismars em gmail.com
Sáb Set 18 07:41:12 -03 2010


  Ricardo,

Como tirar acentos, adapte as tuas necessidades.

SET TERM ^ ;

CREATE OR ALTER PROCEDURE TIRA_ACENTOS (
     dado varchar(512) = '')
returns (
     retorno varchar(512))
as
declare variable com_acento varchar(40) = 'àâêôûãõáéíóúçüÀÂÊÔÛÃÕÁÉÍÓÚÇÜÑñ';
declare variable sem_acento varchar(40) = 'aaeouaoaeioucuAAEOUAOAEIOUCUNn';
declare variable letra varchar(1) = '';
begin
   RETORNO = '';
   While (DADO<>'') do
   begin
      Select case substring(:DADO from 1 for 1)
            when 'à' then
                 'a'
            when 'â' then
                 'a'
            when 'ã' then
                 'a'
            when 'á' then
                 'a'
            when 'À' then
                 'A'
            when 'Ã' then
                 'A'
            when 'Á' then
                 'A'
            when 'ê' then
                 'e'
            when 'é' then
                 'e'
            when 'Ê' then
                 'e'
            when 'É' then
                 'E'
            when 'ô' then
                 'o'
            when 'õ' then
                 'o'
            when 'ó' then
                 'o'
            when 'Ô' then
                 'O'
            when 'Ó' then
                 'O'
            when 'Õ' then
                 'O'
            when 'û' then
                 'u'
            when 'ú' then
                 'u'
            when 'ü' then
                 'u'
            when 'Û' then
                 'U'
            when 'Ú' then
                 'U'
            when 'Ü' then
                 'U'
            when 'í' then
                 'i'
            when 'Í' then
                 'I'
            when 'ç' then
                 'c'
            when 'Ç' then
                 'C'
            when 'ñ' then
                 'n'
            when 'Ñ' then
                 'N'
            else
               substring(:DADO from 1 for 1)
            end
      from rdb$database into :LETRA;

      RETORNO = RETORNO || LETRA;

      DADO  = substring(DADO from 2 for 512);

   end

   suspend;
end^

SET TERM ; ^


Sucesso,

Moacir




Em 17/09/2010 22:08, Ricardo Pereira escreveu:
> Boa Noite, Comunidade Firebasiana!
>
> Venho mais uma fez solicitar a ajuda da comunidade para poder concluir a
> configuração de um banco de dados que estou exportando para o firebird.
>
> 1 - Tirando toda a acetuação dos textos que estão digitado em cada campo do
> banco de dados;
> 2 - Remover os Caracteres especias e os ponto e virgula
> 3 - No final colocar tudo em caixa alta.
>
> Sei que tem como fazer pelo Delphi e ja ate vi em alguns foruns mais queria
> fazer tudo pelo nosso amigo firebird, alguém poderia me orientar como fazer?
>
> Atenciosamente,
>
> Ricardo Rocha
> ______________________________________________
> FireBase-BR (www.firebase.com.br) - Hospedado em www.locador.com.br
> Para saber como gerenciar/excluir seu cadastro na lista, use: http://www.firebase.com.br/fb/artigo.php?id=1107
> Para consultar mensagens antigas: http://firebase.com.br/pesquisa
>




Mais detalhes sobre a lista de discussão lista