set g_grant_ex='gamedb.tb_exchange_'; set @g_grant_ex='gamedb.tb_exchange_'; /*這其實是一樣的效果*/ 第二種,這個就更坑了。我之前看別人用的是云里霧里。后來動手試了幾次才發現。。。。。。。蠻好用的~例子如下
列如:
1.select count(*) into g_err from information_schema.TABLES t where t.TABLE_SCHEMA='gamedb' and t.TABLE_NAME=concat('tb_recharge_',g_year); 2.select count(*) from information_schema.TABLES t where t.TABLE_SCHEMA='gamedb' and t.TABLE_NAME=concat('tb_recharge_',g_year) into g_err; /*這兩個效果也是一樣的*/ 以上是“mysql存儲過程如何變量賦值”這篇文章的所有內容,感謝各位的閱讀!