Remove tab(tab) from sweeping

Asked

Viewed 2,673 times

2

Good afternoon, you guys! I’m trying in every way, but I can’t get a tab at the end of a varchar in Firebird. Someone knows how to do?

From now on, thank you.

Editing to get more specific:

Ex.:

    select guia, convenio, nome, trim(matricula) from tabela  where guia = '142'

    group by guia, convenio, nome, trim(matricula)

the Result

    142 | 1 | Nome do paciente | 111222
    142 | 1 | Nome do paciente | 111222

However, if I remove the registration field, it is a varchar(40) that is with the tabs:

    select guia, convenio, nome from tabela  where guia = '142'

    group by guia, convenio, nome

The Result is:

   142 | 1 | Nome do paciente 

And how I found out the problem was the license plate:

With the help of this function: Char_length(matricula)

    select guia, convenio, nome, Char_Length(matricula) from tabela  where guia = '142'

    group by guia, convenio, nome, matricula

The result:

    142 | 1 | Nome do paciente | 111222 | 6
    142 | 1 | Nome do paciente | 111222 | 10
  • You’ve tried the following? REPLACE('MINHA STRING COM TAB ', ' ', ''). If it doesn’t work glue here the example varchar

  • 1

    I tried yes, it didn’t work, I tried with Trim too... I’ll edit the question to be clearer. Thanks

  • You need to copy the text that is wrong and paste. It is no use you say that it is a TAB, we have to check with the character code to be sure

  • The character code did not appear, I just realized that it was a tab through reverse engineering, even so, thank you, I was able to solve the problem.

2 answers

0


I got it this way:

trim(both from replace(campo, ascii_char(9), ' '))

Thank you all!

0

Try to use this:

SELECT guia, convenio, nome, TRIM(REPLACE(matricula, '\t', ' '))
FROM tabela
WHERE guia = '142'
GROUP BY guia, convenio, nome, TRIM(REPLACE(matricula, '\t', ' '))
  • didn’t work, buddy... all the same... to tell you the truth, I tested and even Tim is not working, with simple spaces......

Browser other questions tagged

You are not signed in. Login or sign up in order to post.