sql >> Database teknologi >  >> RDS >> Oracle

PLS-00539 og PLS-00538 fejl ved oprettelse af UDT-funktioner

Der er få fejl, du lavede under erklæringen, se forklaring inline:

CREATE OR REPLACE TYPE VC_MNumber AS OBJECT
(
   idno NUMBER,
   MEMBER FUNCTION dimension
      RETURN NUMBER,
   MEMBER FUNCTION typeName
      RETURN VARCHAR2
)
   NOT INSTANTIABLE NOT FINAL;
/

--DROP TYPE VC_MINTEGER;

CREATE OR REPLACE  TYPE VC_MInteger
   UNDER VC_MNumber
   (
      OVERRIDING MEMBER FUNCTION dimension
         RETURN NUMBER,
      OVERRIDING MEMBER FUNCTION typeName
         RETURN VARCHAR2
   );
/

CREATE OR REPLACE  TYPE VC_MReal
   UNDER VC_MNumber
   (
      YDCCoeff NUMBER,
      CbDCCoeff NUMBER,
      CrDCCoeff NUMBER,
      OVERRIDING MEMBER FUNCTION Dimension --<--Overriding function should have same name
         RETURN NUMBER,
      OVERRIDING MEMBER FUNCTION typeName
         RETURN VARCHAR2
   )
    FINAL;
/

CREATE OR REPLACE TYPE BODY VC_MReal
AS
   OVERRIDING MEMBER FUNCTION Dimension
      RETURN NUMBER
   IS
      var_dimension   NUMBER := 10;
   BEGIN
      RETURN var_dimension;
   END;

   OVERRIDING MEMBER FUNCTION typeName  --<-- You declared in Object type as `overriding` function and using it as `Member function` alone.
      RETURN VARCHAR2
   IS
      var_typeName   VARCHAR2 (400) := 'VC_MREAL';
   BEGIN
      RETURN var_typeName;
   END;
END;
/



  1. Hvad er nogle gode, hurtige vedvarende lagringsmuligheder for nøgle->værdidata?

  2. MySQL:Hvordan vælger man UTC offset og sommertid for alle tidszoner?

  3. Time DataType i SQL Server 2005

  4. Oracle og paginering