Type with member function : Member Function « Object Oriented « Oracle PL/SQL Tutorial






SQL>
SQL>
SQL> CREATE TYPE cd_keyword_tab_t AS TABLE OF VARCHAR2 (60);
  2  /

Type created.

SQL>
SQL> CREATE TYPE cd_t AS OBJECT(
  2     id                            INTEGER,
  3     title                         VARCHAR2 (60),
  4     artist                        VARCHAR2 (60),
  5     label                         VARCHAR2 (60),
  6     keywords                      cd_keyword_tab_t,
  7     MAP MEMBER FUNCTION compare   RETURN VARCHAR2
  8  );
  9  /

Type created.

SQL> drop type cd_t;

Type dropped.

SQL> drop type cd_keyword_tab_t;

Type dropped.

SQL>








32.3.Member Function
32.3.1.Type with member function
32.3.2.Call Object member function
32.3.3.Type with toString and mapping functions
32.3.4.A sample object type with a MAP member function
32.3.5.A sample object type with an ORDER member function.
32.3.6.This script demonstrates the static method.
32.3.7.Compare two type object instances
32.3.8.This script builds a sample object type with constructor.