0
我有以下MySQL存储过程如何将存储过程的参数传递给选定的列表?
create procedure SP_InsertTag_Level2 (tag_v varchar(50), CNT_v int) select tweet_id into @tid from tweet_tags where tag=tag_v; insert into collected_tags (tag,country) select tag_v, A.country from collected_tags A, tweet_tags B where A.tag=B.tag and [email protected]; select id into @Id from collected_tags where tag=tag_v; IF @Id IS NOT NULL THEN insert into stats_tag(id,counter) values (@id,CNT_v); END IF; end;
现在我得到错误ERROR 1054 (42S22): Unknown column 'tag_v' in 'field list'
上面,因为tag_v不collected_tags表列中的粗体行(它的参数在SP)
我怎能(插入)存储过程中所选列的变量?
OMG ...我怎么错过了!致命的错误!感谢指出 – Alaa
@Alaa,是的,我知道这些隐式连接很容易错过:-)。 – Johan