Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Create Type Body Problem
The code you have supplied looks perfectly reasonable. However, there are a couple of minor details which may be relevant.
Try
return number is
instead of
return integer is
Try:
return self.CustNo - x.CustNo;
instead of
return CustNo - x.CustNo;
You might also change the return to
return sign(self.CustNo - x.CustNo);
since order functions are supposed to return -1, 0, or +1, but that should be a run-time issue, not a compile-time problem.
-- Jonathan Lewis Yet another Oracle-related web site: http://www.jlcomp.demon.co.uk Practical Oracle 8i: Building Efficient Databases Publishers: Addison Wesley Longman Book bound date now 1st Dec 2000 malcolm.chaires_at_intelsat.int wrote in message <8t7b8v$qn6$1_at_nnrp1.deja.com>...Received on Fri Oct 27 2000 - 10:15:11 CDT
>Whenever I issue a Create Or Replace Type Body statement (SQL*Plus),
>the parser seems to terminate the statement at the first semi-colon.
>All statements after that are not recognized. Example:
>
>If I issue the following statement:
>
>CREATE OR REPLACE TYPE BODY Customer_objtyp AS
> ORDER MEMBER FUNCTION
> compareCustOrders (x IN Customer_objtyp) RETURN INTEGER IS
> BEGIN
> RETURN CustNo - x.CustNo;
> END;
>END;
>/
>
>This is what I get:
>
>SQL> CREATE OR REPLACE TYPE BODY Customer_objtyp AS
> 2 ORDER MEMBER FUNCTION
> 3 compareCustOrders (x IN Customer_objtyp) RETURN INTEGER IS
> 4 BEGIN
> 5 RETURN CustNo - x.CustNo;
>
>Operation 2013317271 succeeded.
>
>SQL> END;
>unknown command "END" - rest of line ignored.
>SQL> END;
>unknown command "END" - rest of line ignored.
>SQL> /
>
>Operation 1239173 succeeded.
>
>Anybody ever see anything like this before?
>Thanks to all who reply.
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.
![]() |
![]() |