1
Below the error and the code I’m running
Has two fields of this table that are defined as char(3)
, the field uf
and the countryside ufcrm
.
Does anyone know how I can do this insert
?
SQL error:
ERROR: value Too long for type Character(3)
On the block:
INSERT INTO medico (crm,nome_med,fone1,fone2,fone3,celular,email,abrev,ufcrm,endereco,bairro,cep,cidade,uf,interno,senha,enviawww,padrao,chavesline,uncp_bak,unimed,uncp,status,cpf,espmed_id,datanasc,bpacns,bpacbo,login,obs_med,idopera_ultacao) values ('SP1913','Fulvius Titanero','11942993020',NULL,NULL,NULL,NULL,NULL,NULL,'Rua Eunice Weaver',NULL,'03333060','Sao Paulo','Sao Paulo',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1) RETURNING id
Thank you very much, I will change the "Uf" and I will rotate again to see
Below are a few more bugs I was testing here
SQL error:
ERROR: syntax error at or near "Error" LINE 1: SQL error: On the block:
SQL error:
ERROR: value Too long for type Character(3) In the block: INSERT INTO medico (ufcrm,Uf) values ('1', '1') RETURNING id
ERROR: syntax error at or near "Error" LINE 1: SQL error: On the block:
SQL error:
ERROR: value Too long for type Character(3) In the block: INSERT INTO medico (ufcrm,Uf) values (', ') RETURNING id
OK OK OK> solved was the very size of Uf
thanks to everyone who helped
Uf is receiving "Sao Paulo" which has 9 characters, and only supports 3 characters. In this case, you have to denifir if São Paulo will be 'SP' or you will have to increase the field capacity for more characters. ufcms is the same thing, is inserting 'NULL' that has 4 characters, in a field that only accepts 3 characters
– Edward Ramos