SQL$HELP72.HLB  —  DROP  Routine  Examples
    Example 1: Deleting an external function definition from an
    Oracle Rdb database

    If you want to alter an external function definition, you must
    first delete it and then create it again with the changes you
    plan. This example shows how to delete the COSINE_F function.

    SQL> DROP FUNCTION cosine_f RESTRICT;

    Example 2: Deleting a routine from a stored module

    The DROP FUNCTION and DROP PROCEDURE statements can be used to
    drop routines from a stored module. If the routine is referenced
    by other objects then the CASCADE option may be required to
    successfully drop the routine.

    See also the DROP FUNCTION and DROP PROCEDURE clauses of ALTER
    MODULE which can be used to perform the same task.

    This example removes a function from the stored module TIME_
    ROUTINES that is no longer in use.

    SQL> set dialect 'sql99';
    SQL> create database filename junk;
    SQL>
    SQL> create module TIME_ROUTINES
    cont>
    cont>     function GET_TIME ()
    cont>     returns TIME (2);
    cont>     return CURRENT_TIME (2);
    cont>
    cont>     function DAY_OF_WEEK (in :dt date)
    cont>     returns VARCHAR(10);
    cont>     return case EXTRACT (weekday from :dt)
    cont>             when 1 then 'Monday'
    cont>             when 2 then 'Tuesday'
    cont>             when 3 then 'Wednesday'
    cont>             when 4 then 'Thursday'
    cont>             when 5 then 'Friday'
    cont>             when 6 then 'Saturday'
    cont>             when 7 then 'Sunday'
    cont>             else '***'
    cont>            end;
    cont>
    cont> end module;
    SQL>
    SQL> show module TIME_ROUTINES;
    Information for module TIME_ROUTINES

     Header:
     TIME_ROUTINES
     No description found
     Module ID is: 1

     Routines in module TIME_ROUTINES:
         DAY_OF_WEEK
         GET_TIME

    SQL> drop function GET_TIME cascade;
    SQL> show module TIME_ROUTINES;
    Information for module TIME_ROUTINES

     Header:
     TIME_ROUTINES
     No description found
     Module ID is: 1

     Routines in module TIME_ROUTINES:
         DAY_OF_WEEK

    SQL>
Close Help