56,675
社区成员
发帖
与我相关
我的任务
分享
SET m = CONCAT(N'SELECT COUNT(*) INTO @columnExistsCache FROM information_schema.columns WHERE UPPER(TABLE_SCHEMA) = UPPER('',tableSchema,'') AND UPPER(TABLE_NAME) = UPPER('',tabName,N'') AND UPPER(COLUMN_NAME) = UPPER('',columnName,'');');
SET @sqlStr = m;
PREPARE stmt FROM @sqlstr;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET columnExists = @columnExistsCache;
set @a=null;prepare st from 'select count(*) into @a from information_schema.columns'; execute st; deallocate prepare st; select @a;
mysql> set @a=null;prepare st from 'select count(*) into @a from information_schema.columns'; execute st; deallocate prepare st; select @a;
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Statement prepared
Query OK, 1 row affected, 2 warnings (0.04 sec)
Query OK, 0 rows affected (0.00 sec)
+------+
| @a |
+------+
| 3532 |
+------+
1 row in set (0.00 sec)