Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- create or replace function medieAtribut(
- what in VARCHAR2
- )return float
- AS
- suma float;
- counnt int;
- CURSOR cur_product
- IS
- SELECT
- *
- FROM
- pacienti;
- BEGIN
- suma :=0;
- counnt :=0;
- FOR pacient IN cur_product
- LOOP
- if getValoare(pacient.id_pacient,what)!=-1
- then counnt := counnt + 1;
- end if;
- END LOOP;
- FOR pacient IN cur_product
- LOOP
- if getValoare(pacient.id_pacient,what)!=-1 then
- suma := suma + getValoare(pacient.id_pacient,what);
- end if;
- END LOOP;
- DBMS_OUTPUT.PUT_LINE(suma);
- RETURN suma/counnt;
- END medieAtribut;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement