Stop spool printing the sql query used (Oracle)

joec picture joec · Feb 23, 2010 · Viewed 44.6k times · Source

I have this running in SQLplus

set feedback off
set pagesize 0
spool TypeDrop.sql
select distinct 'drop type '||object_name|| ';' from user_objects where object_type='TYPE';
spool off

It prints out to TypeDrop.sql:

SQL> select distinct 'drop type '||object_name||';' from user_objects where object_type='TYPE';
drop type ADDRESS_OBJTYP; 
drop type PERSON_OBJTYP;                                                                                                                                              
SQL> spool off

How do i get it to just output the drop statements? thanks

Answer

Paolo picture Paolo · Jun 29, 2013

Use sqlplus -s. The -s flag means silent