1
I’m with a client database that with some data without mask for use in my system that is the field NCM
;
The same has 8 digits ( ex.: 0000.00.00), However the same in my system this maskless "00000000" I need to simply put points 4,2,2 but I am not able to mount an Update to do this.
Using this select
I can visualize the same with the Masks :
select codigo,substring(d.classificacao_fiscal from 1 for 4)||'.'||
substring(d.classificacao_fiscal from 5 for 2)||'.'||
substring(d.classificacao_fiscal from 7 for 2) as classificacao_fiscal
from c000025 d
However I cannot generate an Update to update the data in question;
Remembering that the Field NCM
(Varchar 20) this one with the name Classificacao_fiscal
and the table name is c000025
;
Either pro SQL Server or Mysql?
– rray
@Guilhermeneitzelmachado: How the NCM column is declared?
– José Diz
COLUMN Ncm is defined as "Classificaca_fiscal" and the table with the name "c000025"
– Guilherme Neitzel Machado
@rray the script in question would be for SQL
– Guilherme Neitzel Machado
The database appears in order. Formatting characters should normally not be stored, but placed in the view.
– Bacco
Do not format data in the database environment. It is a bad practice, creates processing in the database without need. Formatting data is not the responsibility of the bank. It makes the system more difficult to maintain. Do on the application layer, it was made for this. It will make it easier, faster, it is testable, and you will have more features. It’s my 50 cents.
– Thiago Lunardi