CREATE OR REPLACE procedure TEST
cursor cur_test IS
select a, b, a+b as sum_ab
from table_name;
begin
open cur_test
fetch cur_test INTO a, b, sum_ab
exit fetch when NOT cur_test%found;
DBMS_OUTPUT.PUT_LINE('sum_ab ' || sum_ab);
END LOOP;
CLOSE cur_test;
End test;
|