用Navicat 编写存储过程:
BEGIN
/*定义变量*/
DECLARE time TIMESTAMP;
DECLARE building SMALLINT;
DECLARE floor SMALLINT;
DECLARE room SMALLINT;
DECLARE data_type SMALLINT;
DECLARE data_value SMALLINT;
DECLARE device_id SMALLINT;
/*定义循环标志,默认为false*/
DECLARE done INT DEFAULT FALSE;
/