I need to copy a set of data from one table to another that includes a BLOB
column. I'm using an INSERT
query with 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 get copied correct, except the BLOB
. I know I'm missing something, but I have no idea on how to make this work. Search did not help me. Anyone know how to solve it?
I'd prefer a solution in pure SQL, but I can use Ruby too.