Stop printing the SQL query buffer used by (Oracle)

It works for me 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 on 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 simply output statements drop? thank

+3
source share
3 answers

Works from inside the script, set termout offworks. This does not mean that you simply enter into the terminal.

create myScript.sql:

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

and from your sqlplus query:

SQL> @myScript

will do the trick.

+4
source

Use sqlplus -s. Flag -smeans silence

+6
source

set echo off
0

Source: https://habr.com/ru/post/1734159/


All Articles