Oracle
 sql >> Teknologi Basis Data >  >> RDS >> Oracle

Kesalahan PLS-00539 dan PLS-00538 saat membuat fungsi UDT

Ada beberapa kesalahan yang Anda buat saat deklarasi lihat penjelasan sebaris:

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. Database
  2.   
  3. Mysql
  4.   
  5. Oracle
  6.   
  7. Sqlserver
  8.   
  9. PostgreSQL
  10.   
  11. Access
  12.   
  13. SQLite
  14.   
  15. MariaDB
  1. Bagaimana cara mengambil Komentar dari Oracle 11g menggunakan JDBC?

  2. kesalahan node-Oracledb saat menjalankan prosedur tersimpan NJS-012

  3. Bagaimana cara mendapatkan nama elemen induk dalam ekspresi Oracle XPath?

  4. Kesalahan fatal:Panggilan ke fungsi yang tidak ditentukan oci_connect()

  5. Menulis di ExcelSheet menggunakan paket UTL_FILE di Oracle