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 -> Re: Use of an array NOT number cause error

Re: Use of an array NOT number cause error

From: Mariano <mariano.calandra_at_gmail.com>
Date: Thu, 19 Jul 2007 11:59:07 -0700
Message-ID: <1184871547.383296.218830@r34g2000hsd.googlegroups.com>


On 6 Lug, 19:16, William Robertson <williamr2..._at_googlemail.com> wrote:
> On Jul 6, 1:29 pm, Mariano <mariano.calan..._at_gmail.com> wrote:
>
>
>
> > Then I've this function:
>
> > ======================================
>
> > FUNCTION "SEMIAUTO"(px NUMBER)
>
> > RETURN automatiche AS
>
> > results automatiche := automatiche();
>
> > CURSOR c_class IS
> > SELECT id_mal, SUM(percent) AS p
> > FROM malattie_sintomi
> > WHERE id_sin IN (px)
> > 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;
>
> > ======================================
>
> > As you could see, this function accept a NUMBER in input, this number
> > will be a parameter of my cursor c_class.
> > But number it's not usefull for my job, I need to pass an unknow
> > number of NUMBER (sorry for words joke :D) a sort of array.
>
> > I've write:
>
> > type sinArray is table of number;
>
> > and now header of my function is something like
>
> > FUNCTION "SEMIAUTO"(px SINARRAY)
>
> > But in this way i have a conflict and a message advise me that is
> > needed NUMBER not SINARRAY.
>
> > What I can do?
>
> If parameter PX is a SINARRAY then the IN clause should be
>
> IN (SELECT column_value FROM TABLE(px))
>
> and not
>
> IN (px)

Perfect, in this way function compile without error. How I can call my function in sql???
In this way it doesen't work:
SELECT * FROM TABLE (semiauto( 1 ))

and gave me:
 ORA-06553: PLS-306: wrong number or types of arguments in call to 'SEMIAUTO' Where is my mistake??? Received on Thu Jul 19 2007 - 13:59:07 CDT

Original text of this message

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