11-04-2016 07:32 AM
Hi. I'm using GDatabase to write data to a MySQL server. The project is in Sweden and I would like to be able to write swedish letters å,ä and ö, but that gives me the following error:
<Error from MySQL server>Incorrect string value: '\xE5 defa...' for column 'Title' at row 1
in MySQLVIEW.lvlib:MySQLConnector.lvclass:Insert.vi:700001->testsweletters.vi->test.vi->
I managed to create the query by doing following: I sent an empty MySQL reference into the "Insert query" and this generated the query before returning the error:
Error:
Dequeue Element in Acquire Semaphore.vi:3480001->MySQLVIEW.lvlib:MySQLConnector.lvclass:Insert.vi:700001->Write New Measurement v2 no datacluster.vi
Query:
INSERT INTO `measurement` (Text, Title, UserID, TimeStart) VALUES ("default text", "ÅÄÖ", 9, "2016/11/04 13:28:00.297981");
The query itself is perfect and understood by the MySQL server, but I can't seem to send it through the GDatabase library. Is there a possible workaround?
Kind Regards,
Jonatan Tidare
11-04-2016 08:26 AM
Hi Jonatan,
I think you have to convert your "LabVIEW String" to a UTF8 encoded string by using the "Convert string to UTF8" VI (You will find this VI in GDatabase for MySQL palette -> Utility).
Example :
When you get back data from MySQL server you could have to convert UTF8 encoded String to a "LabVIEW String" by using the "Convert UTF8 to String" VI.
I hope this will work, please let me know,
Regards,
Yannis RICHARD
11-04-2016 09:35 AM
It works! Thank you. I was looking for options in the Insert block itself, but now it works. Thank you for the fast response.
Kind Regards,
Jonatan Tidare