变量定义:
DECLARE variable_name [,variable_name...] datatype [DEFAULT value];
其中,datatype为mysql的数据类型,如:INT, FLOAT, DATE, VARCHAR(length)
例:
DECLARE l_int INT unsigned default 4000000; DECLARE l_numeric NUMERIC(8,2) DEFAULT 9.95; DECLARE l_date DATE DEFAULT '1999-12-31'; DECLARE l_datetime DATETIME DEFAULT '1999-12-31 23:59:59'; DECLARE l_varchar VARCHAR(...