Export BLOB to be SQLite compatible

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
m227
Posts: 75
Joined: Mon 06 Aug 2007 12:41

Export BLOB to be SQLite compatible

Post by m227 » Tue 09 Feb 2016 09:47

Dear Sirs,
I'd like to export some data to SQL file with TMyDump to be able to import it with TLiteDump later. One of my field is a blob field (with 32 bytes).
Unfortunately neither of two ways with HexBlob true or false does not work. One of then produces a value like: 0x14050944092349222a... which cannot be imported as it appears as too long value. Second one contains inaccessible characters and is exported as NULL value to SQL.

The best would be format x'1405094409.....' which is widely accepted by SQLite. I tried to achieve this format with query as below but I failed.
SELECT CONCAT("x",0x27,HEX(params),0x27)
- this is embraced with apostrophes and internal apostrophes are slashed '\'. Do you have any hint?

I d'like to stay with SQL text file to be able to send it through FTP to another PC.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Export BLOB to be SQLite compatible

Post by ViktorV » Tue 23 Feb 2016 11:41

You can use the TCRBatchMove component, that allows to migrate data between different datasets. See more details about it in the documentation: https://www.devart.com/unidac/docs/?dev ... chmove.htm
The TMyDump and TLiteDump components allow save and restore data according to specificities of a certain DBMS (MySQL server and SQLite respectively). We can't change this behavior of MyDAC, since such a modification will break functionality at all existing users' side. You can buy MyDAC Professional Edition with source code - and we will tell you how to modify this behavior manually.

Post Reply