От: | Funny Rabbit | ||
Дата: | 19.10.22 12:14 | ||
Оценка: |
create procedure updateAP()
READS SQL DATA
DETERMINISTIC
begin
declare v_id int;
declare v_parent_id int;
declare v_type varchar(50);
declare v_tree_id int;
declare v_pos int;
declare v_temp_data varchar(100);
declare v_data varchar(100);
DECLARE cur CURSOR FOR SELECT something from sometable;
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;
OPEN cur;
WHILE done = 0 DO
FETCH cur INTO v_id, v_parent_id, v_tree_id, v_type, v_pos, v_data;
IF NOT done THEN
IF v_type = 'month_period' THEN
set v_temp_data = set_cost_date(v_data, '01.11.2022');
elseif v_type = 'month_cost' THEN
set v_temp_data = set_cost(v_data);
end if;
insert mtree_node(parent_node, mtree_id, type, data, pos)
values(last_insert_id(), v_tree_id, v_type, v_temp_data, v_pos);
END IF;
END WHILE;
CLOSE cur;
end;
[HY000][1193] Unknown system variable 'done'
От: | BlackEric | http://black-eric.lj.ru | |
Дата: | 19.10.22 12:41 | ||
Оценка: |
FR> [HY000][1193] Unknown system variable 'done'
От: | kov_serg | ||
Дата: | 19.10.22 13:02 | ||
Оценка: | 4 (1) +4 |
А разве её не надо предварительно определить?[HY000][1193] Unknown system variable 'done'
declare done int default 0;