使用的表类型不支持 BLOB/TEXT 列 [英] The used table type does not support BLOB/TEXT columns

查看:55
本文介绍了使用的表类型不支持 BLOB/TEXT 列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在我的存储过程中创建一个临时表,该表从另一个文本表中获取一列数据.但我得到了

I am attempting to create a temp table in my stored procedure that obtains a column of data from another table that is text. But I am getting the

使用的表类型不支持 BLOB/TEXT 列

used table type does not support BLOB/TEXT columns

留言.我怎样才能解决这个问题?这是我的代码,2015Consumer_stage 是包含文本列的表.

message. How can I get around this? This is my code, 2015Consumer_stage is the table containing the text column.

CREATE DEFINER=`root`@`localhost` PROCEDURE `uspLoadStateTables`()
BEGIN
    DECLARE state varchar(2);
    DECLARE rowcount int;

    create temporary table statelist(TheState varchar(2)) engine=memory SELECT DISTINCT TRIM(ST) FROM `2015consumer_stage`;

select count(*) into rowcount from statelist;
select TheState into state from statelist;

推荐答案

MySQL 不支持 MEMORY/HEAP 表的 TEXTBLOB.请参阅此处.支持 VARCHAR() 但您应该尝试使用 CHAR() 代替.无论如何,MySQL 会将其存储为固定长度.

MySQL does not support TEXT or BLOB for MEMORY / HEAP tables. See here. VARCHAR() is supported but you should try using a CHAR() instead. MySQL will store it as fixed-length anyway.

这篇关于使用的表类型不支持 BLOB/TEXT 列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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