0

I am printing tablespace names in oracle but am facing duplicate data issue on the sqlplus console. Please share your thoughts if you know how to avoid this issue.

set heading on
set echo off
set feedback off trimspool on verify off
set lines 120
set pages 2000
prompt DATE
select sysdate from dual;
/
prompt
prompt
prompt =====================================
prompt            Tablespaces
prompt =====================================
break on report
select name from v$tablespace ;
/

clear break
clear compute

TableSpace_List

Alfabravo
  • 7,493
  • 6
  • 46
  • 82
Dex
  • 388
  • 5
  • 31
  • 2
    See this thread: https://stackoverflow.com/questions/1079949/when-do-i-need-to-use-a-semicolon-vs-a-slash-in-oracle-sql – SmartDumb Nov 16 '17 at 20:04

1 Answers1

1

And as the docs say about "slash": https://docs.oracle.com/cd/E18283_01/server.112/e16604/ch_twelve004.htm

Executes the most recently executed SQL command or PL/SQL block which is stored in the SQL buffer.

So select name from v$tablespace ;is executed twice in your case

SmartDumb
  • 348
  • 3
  • 15