Skip to content
Advertisement

how to drop multiple functions in Oracle

I want to drop multiple functions from my database at a time in Oracle’s SQL developer. Is anyone has an idea how to create a script for that?

Advertisement

Answer

Well, the static option to drop the functions (sometimes considered more secure as you can double-check what you are removing) consist of two steps

1 – run the following query

select 'drop function '||object_name||';'  as sql_txt
from user_objects where object_type = 'FUNCTION' 
and object_name like 'F%' /* filter the selection here */
order by 1;

SQL_TXT                                                                                                                                        
-----------------
drop function FA;
drop function FB;
drop function FC;

2 – copy the result drop statements in SQL Developer window and execute them

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement