I try to insert a Open Office document on a blob field. To do this I try
INSERT INTO my_table (stamp, docFile) VALUES (NOW(), LOAD_FILE('/tmp/my_file.odt'));
This works well on windows but on Mac Os the file isn't load on docFile field.
Is anyone has experience about that?
Thanks
File.separator is either / or \ that is used to split up the path to a specific file. For example on Windows it is \ or C:\Documents\Test. But on Mac it is /.
So use File.separator instead of / or \, then it will work for both Mac and Windows.
You can Update the column value having type 'blob'
UPDATE `TableName` SET `ColumnName`=LOAD_FILE('FilePath/FileName.bin') WHERE `YourCondition` 
// FilePath -> C:/foldername/filename.bin
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With