复制/复制SQL行与blob /文本,怎么做? [英] Copy/duplicate SQL row with blob/text, How do that?

查看:660
本文介绍了复制/复制SQL行与blob /文本,怎么做?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,对于我的英文,我是法语。

First, sorry for my english, I'm French.

所以,我想在同一张表中复制一个SQL的行。
但是在我的表中,我有一个'text'列。

So, I would like to copy a SQL's row in the same table. But in my table, I've a 'text' column.

使用这个sql:

CREATE TEMPORARY TABLE produit2 ENGINE=MEMORY SELECT * FROM produit WHERE pdt_ID = 'IPSUMS';
UPDATE produit2 SET pdt_ID='ID_TEMP';
INSERT INTO produit SELECT * FROM produit2;
DROP TABLE produit2;

我有这个错误:

#1163 - The used table type doesn't support BLOB/TEXT columns

这是我的表:

pdt_ID varchar(6)
pdt_nom varchar(130)
pdt_stitre varchar(255)
pdt_accroche varchar(255)
pdt_desc text
pdt_img varchar(25)
pdt_pdf varchar(10)
pdt_garantie varchar(80)
edit_ID varchar(7)
scat_ID int(11)
pdt_asso1 char(3)
pdt_asso2 char(3) 
pdt_online tinyint(4)

有可能帮我重复行吗?如何?

It's possible to help me to duplicate row ? How?

非常感谢帮助我。
注意,Dangan

Thank a lot to help me. Regards, Dangan

推荐答案

您不能在内存表中存储TEXT-columns(其实是blob)。请参阅此处

You can't store TEXT-columns (which really are blobs) in memory tables. See here

根据您的最终目标,您可以插入TEXT-column的md5-hash,以保留实体身份。否则,您需要将pdt_desc等放在另一个表中,并参考它的主键 - 这将为您节省一些存储/内存。

Depending on your ultimate goal, you may insert a md5-hash of the TEXT-column instead to preserve entity identity. Otherwise you need to put pdt_desc and such into another table and refer to it's primary key - that will save you some storage/memory too.

这篇关于复制/复制SQL行与blob /文本,怎么做?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆