From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
09-19-2012 04:31 AM
hy!
i'm trying to send a SELECT query to a mysqlserver by calling the needed functions in libmysql.dll
i get a successful connection and can read the server-version, but the result of the query which should be something like DATETIME|INT|INT and so on is quite a mess:
“À›ÀŸÀ2012-02-13 08:40:46
I read in the documentation of fetch_lenght, that this function should recieve an array, but how can i tell a Call llibrary function node to return a array?
libmysql.dll i used: mysql-connector-c-noinstall-6.0.2-win32.zip
09-19-2012 09:24 AM
Is there a reason you are going about this the hard way with the dll instead of the database connectivity toolkit or any one of a number of free options for using standard SQL? I doubt that you will find many (if any at all), that have tried your approach.
09-19-2012 11:13 AM
I used the DBToolkit in the first way but it should be a executable wich can be used without installing any other software (ODBC e.g.). I also tried the solution from SAPHIR but this one is extremly slow with large querys. It should also work as 32 and 64 bit executable
I read something about using the Call library function node with LabVIEW instad of a DLL but i can't geht it working.
https://decibel.ni.com/content/docs/DOC-9091
09-19-2012 11:35 AM
So instead of installing the small odbc driver, you would rather install the dll? And, you would need to support both 32 and 64 bit dll's. Sorry, I can't help.
09-19-2012 01:56 PM
How to read a function return pointer that is an array, can be seen here. Kind of messy I know, but interfacing C is a mess in comparison to LabVIEW programming.
For the rest I think I fully agree with Dennis. Lots of sweat and work for a questionable benefit. And your strange data probably comes from binary and text data being mixed in the returned pointer based on the column datatype. Good luck with creating a LabVIEW VI library that can handle that transparently.
09-20-2012 03:34 AM
One possibility could be to open a TCP connection to mysql and send queries / commands via that.
I did this with some success many years ago. Unfortunately I no longer have access to the code.
It'll still be considerably more work than using odbc though.
Good luck!
04-20-2016 11:43 AM
did you make it work?
what was the result?
Can you share your final VI?
Thank you.