| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.misc -> How to pass an array as function parameter
I've to write a function with new type, then I create new type:
CREATE TYPE automatica AS OBJECT (id_mal NUMBER ,percent NUMBER) CREATE TYPE automatiche AS TABLE OF automatica CREATE TYPE sinArray AS TABLE OF number
And finally the real function:
RETURN automatiche AS
results automatiche := automatiche();
CURSOR c_class IS
SELECT id_mal, SUM(percent) AS p
FROM malattie_sintomi
WHERE id_sin IN ( SELECT column_value FROM TABLE(CAST(px as
SINARRAY)) )
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 problem is: how can I use this function????
Using:
SELECT * FROM TABLE (semiauto( (1) ))
I obtain:
ORA-06553: PLS-306: wrong number or types of arguments in call to
'SEMIAUTO'
PS: Function compile without problem.
Received on Thu Jul 19 2007 - 14:27:15 CDT
![]() |
![]() |