Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> ORA-00932 What is wrong???

ORA-00932 What is wrong???

From: Mariano <mariano.calandra_at_gmail.com>
Date: Fri, 06 Jul 2007 04:56:23 -0700
Message-ID: <1183722983.551253.3610@g13g2000hsf.googlegroups.com>


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;

    RETURN results;
    END;
/

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US