如何使用更新将 BLOB 数据附加/连接到 BLOB 列?

Avi*_*ash 4 mysql sql database

我需要将数据附加到我的 BLOB 字段,如何使用update? 我要问的是;是否可以连接 blob 数据,以便我可以使用此新数据更新 blob 字段。就像是:

UPDATE BLOB_table 
   SET BLOB_field = BLOB_field + BLOB_data
Run Code Online (Sandbox Code Playgroud)

bar*_*sju 6

Concat 应该工作..

UPDATE BLOB_table SET BLOB_field = CONCAT(BLOB_field, BLOB_data);
Run Code Online (Sandbox Code Playgroud)

我用这个测试过:

CREATE TABLE `Blobs` (
  `id` int(11) NOT NULL,
  `b` blob,
  PRIMARY KEY  (`id`)
) 

insert into Blobs values (1, "heel");

update Blobs set b = concat(b, "heelele");
Run Code Online (Sandbox Code Playgroud)

也许这只是有效,因为我将字符串粘贴到 Blob 中......