The used table type does not support BLOB/TEXT columns

只愿长相守 提交于 2019-12-11 11:14:06

问题


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

used table type does not support BLOB/TEXT columns

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;

回答1:


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.



来源:https://stackoverflow.com/questions/31468080/the-used-table-type-does-not-support-blob-text-columns

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!