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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Create Type Body Problem

Re: Create Type Body Problem

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Fri, 27 Oct 2000 15:15:11 -0000
Message-ID: <972660029.21002.0.nnrp-03.9e984b29@news.demon.co.uk>

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>...

>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.
Received on Fri Oct 27 2000 - 10:15:11 CDT

Original text of this message

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