Mega Code Archive

 
Categories / Oracle PLSQL Tutorial / Object Oriented
 

Type with member function

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>