LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

uploading image data flattened to string into mysql blob field

I have an Imaq template that I have flattened to a string using "Imaq flatten to string" after that I use the Open g Toolkit zlib functions to compress the string. I want to then insert this into a blob field in mysql. I am having problems with the sql statement. I can insert using php my admin, but I am also having trouble retrieving the information once it is in. I see the sql statement that php uses and have no idea how to get my information into that format.

The php data format is: 0x5675a78686b89897d7879879f78987554a....etc.(obviously it is hex)

Conn Execute.vi->Write to DB.vi->vision proto.vi<ERR>Exception occured in Microsoft OLE DB Provider for ODBC Drivers: ODBC driver does not support the requested properties. in Conn Execute.vi->Write to DB.vi->vision proto.vi

this the error I get above

I've been banging my head for a few days now. If anybody can help it would be greatly appreciated. Also I cannot use the file path and seperate file option for my use case.
0 Kudos
Message 1 of 2
(4,245 Views)
Hi OzRuiz,

You should be able to use the string output from the zlib VI and write that directly to the database BLOB field.  PHPmyAdmin is converting the file to hex before uploading it.  The BLOB field in MySQL simply holds binary data so the output of the zlib function should work.  I see that you are getting this error when actually writing to the Database.

How exactly are you attempting to write this data to the Database in LabVIEW?  Are you using the Database Connectivity VIs?  Are you using an insert function or are you building an SQL Query Statement and then executing that?  What is the SQL Query Statement that you are using to write this data?

If you could provide a small code snippet or a screenshot of the section of code that is writing this data to the Database, that might help better determine what exactly needs to be done.
0 Kudos
Message 2 of 2
(4,228 Views)