DEClARE my_cursor CURSOR FOR SELECT id name FROM Dictionary DECLARE CO

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
DEClARE my_cursor CURSOR FOR
SELECT id, name FROM Dictionary;
DECLARE CONTINUE HANDLER
FOR NOT FOUND SET v_finished = 1;
OPEN my_cursor;
]
FETCH my_cursor INTO id_s, name_s;
size: LOOP
FETCH my_cursor INTO id_s, name_s;
IF v_finished = 1 THEN
LEAVE size;
END IF;
END LOOP size;
CLOSE my_cursor;