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 -> Method in oracle

Method in oracle

From: Profetas <xuxu_18_at_yahoo.com>
Date: Sun, 23 May 2004 14:54:22 -0400
Message-ID: <8df1479fc98ff7bbc0ac1038d44df365@localhost.talkaboutdatabases.com>


Hi I have this function

CREATE TYPE BODY licence_t AS MEMBER FUNCTION get_penalty_points RETURN INTEGER IS
p number;
y number;
BEGIN
select z.penalty_p into p from conv_speed z, licence a where z.speed_li = ref(a) ;
return y = y + p;
END get_penalty_points;
END;
/

My goal is to sum the values of a tuple that belong to a person ID into P.

but this will return more than one row.
I get this error

select z.get_penalty_points() from licence z *
ERROR at line 1:

ORA-01422: exact fetch returns more than requested number of rows
ORA-06512: at "OPS$MYID.LICENCE_T", line 5
ORA-06512: at line 1
Received on Sun May 23 2004 - 13:54:22 CDT

Original text of this message

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