I'm using Scriptella for database migration. What would be the best approach to copy a longblob field from table A to table B ?
When I do this job like this:
<query ...
SELECT FL_DATA as data FROM A where FL_DATA IS NOT NULL
<script ...>
INSERT B (FL_DATA) VALUES ('$data');
</script>
</query>
then it will just write 'BLOB: java.io.IOException: Content too long to fit in memory' into the destination field (btw: the size of the longblob is just a few kBytes).
When $variable syntax is used, a text value of the variable is simply inserted into statement's text. A recommended approach would be to use prepared statements syntax. In this case values will be transferred separately from the SQL statement. Please try the following: