| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.misc -> ORA-00932 What is wrong???
Then I've used an example from book of Urman, Hardman and McLaughin
(Oracle Database 10g PL/SQL Programming) exactly the example of the
"Function with multiple values" (Chapter 9.3 in Italian edition).
CODE:
TYPE automatica AS OBJECT
(id_mal NUMBER
,percent NUMBER);
/
TYPE automatiche AS TABLE OF automatica;
/
FUNCTION "SEMIAUTO" RETURN automatiche AS
results automatiche := automatiche();
CURSOR c_class IS
SELECT id_mal, SUM(percent) AS p
FROM malattie_sintomi
WHERE id_sin IN (1)
and id_mal in (select id_mal from malattie_sintomi group by
id_mal having count(*) >= 1)
GROUP BY id_mal;
BEGIN
FOR v_Rec IN c_class LOOP
results.EXTEND;
results(results.LAST) := automatica(v_Rec.id_mal,
v_Rec.p);
END LOOP;
My malattie_sintomi, table used by cursor is:
id_mal NUMBER
id_sin NUMBER
percent NUMBER
All is compiled pretty easy, the only problem appear when I run: select semiauto() from dual;
ORA-00932: inconsistent datatypes: expected NUMBER, got CC.AUTOMATICHE
How can I resolve this problem??? Received on Fri Jul 06 2007 - 06:56:23 CDT
![]() |
![]() |