Hi,
    try to run this select and then think how to adjust it:

SELECT (3*COUNT(*)) count
, empnum
, yr
FROM load
GROUP BY empnum, load

and maybe I did not understand your question correctly, so just reply and specify types and demands

but if you make such select as view and then query it with proper WHERE clause, you may not need any FUNCTION

regards

Andrej Hopko


On 12. 8. 2010 18:40, Richie wrote:
hey good day

  i was wondering if anyone could help me out with the code below.

i'm trying the count the total number of courses an employee has and
to be able to take this number and multiply it by 3.


create or replace function cal_total_credit(EMPNUM IN number, YR IN
number, hpw IN number)
return number is
lv_total        number := 0;


cursor c is
select TITLE_CODE from LOAD
where EMPNUM = EMPNUM
and YR = YR;

BEGIN
for i in c loop
        lv_total := lv_total + i.count("TITLE_CODE");
end loop;


RETURN ((hpw*13)+(lv_total*3));


end cal_total_credit;


Thanks in advance
Richie


--
You received this message because you are subscribed to the Google
Groups "Oracle PL/SQL" group.
To post to this group, send email to Oracle-PLSQL@googlegroups.com
To unsubscribe from this group, send email to
oracle-plsql-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/Oracle-PLSQL?hl=en

Reply via email to