问题
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