Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Is it possible to parse a cursor record into a function if so how?

635333Apr 23 2008 — edited Apr 23 2008
My 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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 21 2008
Added on Apr 23 2008
4 comments
426 views