MySQL将数据从一个表插入另一个表 - 错误FULLTEXT索引

时间:2015-12-01 03:51:41

标签: mysql fulltext-index

嘿伙计们我正在尝试创建一个存储过程,我从loan_table输入Loan_ID并将其移动到另一个名为loan_history的表中。我不确定我做错了什么。我得到的错误是'找不到与列列表匹配的FULLTEXT索引'

CREATE PROCEDURE `INSERT_INTO_lOAN_HISTORY`(in INSERT_LOAN_ID INT(11))
INSERT into loan_history
SELECT  *
FROM `loan_table`
Where MATCH (LOAN_ID) AGAINST (INSERT_LOAN_ID)

模式

CREATE TABLE loan_table 
( Loan_ID int(11) NOT NULL AUTO_INCREMENT, 
Member_ID int(11) DEFAULT NULL, 
Item_ID int(11) DEFAULT NULL, 
Book_ID varchar(45) DEFAULT NULL, 
Video_ID varchar(45) DEFAULT NULL, 
Transaction_Date date DEFAULT NULL, 
Due_date date DEFAULT NULL,
etc

1 个答案:

答案 0 :(得分:0)

对于其他用户和将来的参考,解决方案是删除MATCH并将WHERE条件更改为ID等于IN参数中的ID值。

CREATE PROCEDURE `INSERT_INTO_lOAN_HISTORY`(in INSERT_LOAN_ID INT(11))
INSERT into loan_history
SELECT  *
FROM `loan_table`
WHERE Loan_ID = INSERT_LOAN_ID