x
1
BEGIN
2
3
DECLARE done INT DEFAULT 0;
4
5
DECLARE x INT DEFAULT 0;
6
7
DECLARE a VARCHAR(20);
8
9
DECLARE b VARCHAR(10000);
10
11
DECLARE cur1 CURSOR FOR select Name from processes where computerid=CID;
12
13
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;
14
15
OPEN cur1;
16
17
set b=' ';
18
19
REPEAT
20
21
FETCH cur1 INTO a;
22
23
set b=concat(b,',',a);
24
25
UNTIL done end REPEAT;
26
27
CLOSE cur1;
28
29
Delete from processes where computerid=CID;
30
31
return b;
32
33
END