Search code examples
oracle-databaseordbms

How can I delete a member function created in oracle


How can I delete a member function created inside oracle type object without dropping the entire type?


Solution

  • I never used it but according documentation you might be able to use

    alter type {type_name} DROP MEMBER {function_spec} CASCADE;
    

    Note, {function_spec} is the function name plus RETURN clause, e.g.

    ALTER TYPE ttest DROP MEMBER FUNCTION f_name_2 RETURN VARCHAR2 CASCADE;
    

    Afterwards you have to re-create the TYPE BODY without the dropped function, i.e. CREATE OR REPLACE TYPE BODY ...