0
I need to mask my CPF field / CNPJ direct on Firebird, I tried the command below but it shows error, can anyone help me?
UPDATE EMPRESA
SET EMP_CPF_CNPJ =
SUBSTRING(EMP_CPF_CNPJ from 1 for 2) + '.'
+ SUBSTRING(EMP_CPF_CNPJ from 3 for 3) + '.'
+ SUBSTRING(EMP_CPF_CNPJ from 6 for 3) + '/'
+ SUBSTRING(EMP_CPF_CNPJ from 9 for 4) + '-'
+ SUBSTRING(EMP_CPF_CNPJ from 13 for 2)
And why would you do that? The CNPJ consists only of numbers, these symbols are used to facilitate the reading by humans in the presentation, nothing more.
– Maniero
I had to change in the system to leave the mask fixed, only the data already registered does not appear in the fields even if they are masked
– j_ferrareze
I believe that the best treatment in this case is, after recovering the database data, apply the mask through your application, before promoting the display of the data.
– Sérgio Lopes