DECLARE cur_test CURSOR FOR
SELECT contect FROM Mytable where id = :ai_id;
fetch cur_test into :ls_test ;
do while sqlca.sqlcode = 0
ls_contect = ls_contect + ls_test
loop
DECLARE cur_test CURSOR FOR
SELECT contect FROM Mytable where id = :ai_id;
fetch cur_test into :ls_test ;
do while sqlca.sqlcode = 0
ls_contect = ls_contect + ls_test
loop