码迷,mamicode.com
首页 > 其他好文 > 详细

1327-Undeclared variable:amount

时间:2016-01-11 20:30:03      阅读:299      评论:0      收藏:0      [点我收藏+]

标签:

1、错误描述

技术分享


2、错误原因

BEGIN
	SELECT stuAge INTO amount;
  IF stuAge IS NOT NULL THEN
  SET stuAge = stuAge + 1;
  SELECT stuAge INTO amount1;
  ELSE
  SELECT 20 INTO amount2;
  END IF;
  SELECT stuAge INTO amount3;
END;

   amount实际是stuAge的别名,但是却写成了一个变量


3、解决办法

BEGIN
	SELECT stuAge AS amount;
  IF stuAge IS NOT NULL THEN
  SET stuAge = stuAge + 1;
  SELECT stuAge AS amount1;
  ELSE
  SELECT 20 INTO stuAge;
  END IF;
  SELECT stuAge AS amount3;
END


1327-Undeclared variable:amount

标签:

原文地址:http://blog.csdn.net/you23hai45/article/details/50499052

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!