标签:set weight pre 改变 tin handle handler image continue
源代码如下:
BEGIN DECLARE i INT; DECLARE time_1 datetime; DECLARE ID_1 int; DECLARE charge_1 FLOAT; DECLARE length_1 FLOAT; DECLARE err_1 FLOAT; DECLARE RSSI_1 FLOAT; DECLARE stopflag INT DEFAULT 0; TRUNCATE TABLE 220_1_copy;
DECLARE mycursor CURSOR FOR SELECT time,ID,charge,length,err,RSSI FROM 220_1 WHERE index_1 <100; DECLARE CONTINUE HANDLER FOR NOT FOUND SET stopflag=1; OPEN mycursor; REPEAT FETCH mycursor INTO time_1,ID_1,charge_1,length_1,err_1,RSSI_1; INSERT INTO 220_1_copy SET time=time_1,ID=ID_1,charge=charge_1,length=length_1,err=err_1,RSSI=RSSI_1; UNTIL stopflag=1 END REPEAT; CLOSE mycursor; END
保存代码提示:
改变红色代码 truncate table的位置就没事了如下:
BEGIN #Routine body goes here.. DECLARE i INT; DECLARE time_1 datetime; DECLARE ID_1 int; DECLARE charge_1 FLOAT; DECLARE length_1 FLOAT; DECLARE err_1 FLOAT; DECLARE RSSI_1 FLOAT; DECLARE stopflag INT DEFAULT 0; DECLARE mycursor CURSOR FOR SELECT time,ID,charge,length,err,RSSI FROM 220_1 WHERE index_1 <100; DECLARE CONTINUE HANDLER FOR NOT FOUND SET stopflag=1; TRUNCATE TABLE 220_1_copy; OPEN mycursor; REPEAT FETCH mycursor INTO time_1,ID_1,charge_1,length_1,err_1,RSSI_1; INSERT INTO 220_1_copy SET time=time_1,ID=ID_1,charge=charge_1,length=length_1,err=err_1,RSSI=RSSI_1; UNTIL stopflag=1 END REPEAT; CLOSE mycursor; END
不知道为啥!!!
标签:set weight pre 改变 tin handle handler image continue
原文地址:https://www.cnblogs.com/flash610/p/14808403.html