1DECLARE
2 existing_type number;
3BEGIN
4 SELECT count(*) into existing_type
5 FROM ALL_TYPES
6 WHERE TYPE_NAME = 'type_name' AND OWNER = 'schema_name';
7 IF existing_type = 1 then
8 EXECUTE IMMEDIATE 'DROP TYPE schema_name.type_name';
9 END IF;
10END;