Copying BLOB data from one table to another in MySQL

I need to copy a dataset from one table to another, which includes a column BLOB. I am using a query INSERTwith a subquery SELECT:

INSERT INTO dest_table(field1,field2,field3,blobfield,field4) (SELECT t.myfield1,t.myfield2,t.id,t.blobfield,'SomeConstant' FROM tablename t)

All fields are copied correctly, except BLOB. I know that something is missing, but I have no idea how to do it. The search did not help me. Does anyone know how to solve it?

I would prefer a solution in pure SQL, but I can use Ruby too.

+5
source share
1 answer

: - MEDIUMBLOB, BLOB. , . .

+6

All Articles