Is it possible to parse a cursor record into a function if so how?
635333Apr 23 2008 — edited Apr 23 2008My question is basically as the title says. I would like to know if i can parse a cursor record through a function
for example
FOR r1 in c1
LOOP
calcuate(r1.mark1, r1.mark2,r1.mark3, r1.student)
END LOOP
where fucntion looks similar to
CREATE function calculate(mark1 NUMBER, mark2 NUMBER, mark3 NUMBER, student VARCHAR2(15))
RETURN NUMBER
IS
total NUMBER;
--
BEGIN
SELECT avg(all_marks) into total
from table
where mark1 = table.mark10 and
mark2 > 100 and
mark3 > 70;
return NVL(total,0);
end;
if this is not possible how else can i do the specific task, where a cursor record is used to do a similar query to what the function does.