#1 2015-07-09 10:35:08

sergioschel
Member
From: Brazil
Registered: 2014-10-23
Posts: 9

Syntax Error MySQL for INSERT command with special characters

Hi,

What should I set to work the INSERT command with special character? Ex.: ç, é, á, à, ã...

**** server***
ModeloDados := TSQLModel.Create([], ROOT_NAME);
ModeloServicos := TSQLModel.Create([],'rap_services');
ServidorServicos := TSQLRestServerFullMemory.Create(ModeloServicos);
ServidorServicos.ServiceRegister(TServiceRemoteSQL,[TypeInfo(IRemoteSQL)], sicShared);
BaseDados := TSQLDBZEOSConnectionProperties.Create('zdbc:mysql://localhost:3306/rap?username=root;'+
                                                      'password=root;characterSetResults=utf8;'+
                                                      'MYSQL_OPT_RECONNECT=TRUE',
                                                      'teste', '', '');
BaseDados.ThreadingMode := tmMainConnection;
ConexaoBD := BaseDados.ThreadSafeConnection;
ServidorDados := TSQLRestServerFullMemory.Create(ModeloDados);
ServidorHTTP := TSQLHttpServer.Create('8080', [ServidorServicos]);

****client****
POST command INSERT: insert into testes (coluna) values ('Análise')
SQL Error: Incorrect string value: '\\xE1lise:...' for column 'coluna' at row 1

Offline

#2 2015-07-09 20:12:01

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Syntax Error MySQL for INSERT command with special characters

How do you insert the data?

Offline

Board footer

Powered by FluxBB