1

I tried with:

clear screen (not work)

enter image description here

J. Chomel
  • 8,193
  • 15
  • 41
  • 69

3 Answers3

7

You are trying to clear a toad DBMS Output screen using clear screen command. Unfortunately, tools like toad are not supporting all the SQLPLUS command. You can use clear screen command when you are logged in with SQLPLUS. See below ways to clear the screen

SQL> clear screen

which can also be shortened to

SQL> cl scr

And you can also use:

SQL> host clear  

Or

SQL> ho clear

For your toad , in the DBMS Output tab there is first button right to watch, is used to clear the output of buffer.

XING
  • 9,608
  • 4
  • 22
  • 38
  • @J.Chomel He looked confused with Toad and SQLPLUS – XING Nov 09 '17 at 13:38
  • I used all, only Toad recognize the word "clear" , the others not are recognize. But when I try with clear screen I get this error: (PLS-00103: Encountered the symbol "SCREEN" when expecting one of the following: := . ( @ % ;). In my begin want put this clean window, I have a big log, and I need refresh. –  Nov 10 '17 at 07:20
  • @delive `the others not are recognize` what are others here ? Also can you show how are you using clear in toad. I told you a button to click in toad to clear the buffer . Did you try that , – XING Nov 10 '17 at 07:48
  • @XING the button works correctly, and F7 to clear DBMS_OUTPUT, but I need a command, to clean automatically. –  Nov 10 '17 at 09:53
  • 1
    @delive In toad you cannot use the command. Toad is a tool which doesnot support these commands. These command are meant for `SQLPLUS` – XING Nov 10 '17 at 09:55
  • Hi XING, can you put this in your post ? " you cannot use the command. Toad is a tool which doesnot support these commands" Thanks. –  Nov 13 '17 at 09:50
  • @delive Why you unaccepted the answer. Did it not work for you or is there something you didnot understand ? – XING Mar 26 '18 at 05:31
  • because it does not solve the problem I had, I do not think it's convenient to accept your answer, when I was marked negative. that is, they mark me negative and I have to accept an invalid answer? I think not. –  Mar 26 '18 at 20:38
  • Then why you accepted it earlier. It took so many months for tou to understand that solution didnot work for you. Anyways... – XING Mar 27 '18 at 03:09
1

You may try

dbms_output.enable(100000);

Keep in mind that you'll only see results once your PL/SQL block is over. It's not immediate to see result from Oracle PL/SQL during execution. You may try something like explained here.

J. Chomel
  • 8,193
  • 15
  • 41
  • 69
  • @J.Chomel OP question is more about tool oriented. From Toad for Oracle he is trying to run `clear screen` which will never work. Not sure if your answer really fits what he needs – XING Nov 09 '17 at 12:58
  • @XING, yeah, too bad for me, I don't have Toad anymore so can't test a thing. – J. Chomel Nov 09 '17 at 13:40
  • @J. Chomel, I tried in my BEGIN block, and not work, I want say, not clean the window DBMS_OUTPUT –  Nov 10 '17 at 07:21
0

We can use enable/disable option of DBMS_OUTPUT to either keep DBMS_OUTPUT Console clean or print the instructions you wanted to be passed.

For a sample code

Begin
DBMS_OUTPUT.DISABLE;

--code you want to ignore

DBMS_OUTPUT.PUT_LINE('HI');
DBMS_OUTPUT.ENABLE;
DBMS_OUTPUT.PUT_LINE('Hello');
Dilan
  • 2,610
  • 7
  • 23
  • 33