如何在sqlplus中禁止“PL / SQL过程成功完成”消息?

时间:2008-10-30 15:08:53

标签: oracle plsql sqlplus

有没有办法让你可以在sqlplus中将SERVEROUTPUT设置为ON但是以某种方式抑制在完成执行plsql过程后自动生成的消息“PL / SQL过程成功完成”?

2 个答案:

答案 0 :(得分:51)

使用命令:

SET FEEDBACK OFF

在运行程序之前。然后你可以再次打开它:

SET FEEDBACK ON

答案 1 :(得分:0)

这在sqlplus中对我来说效果很好,但我确实注意到“关闭反馈”抑制了Sql Developer(至少17.2.0.188版)中的错误。如果您使用Sql Developer,则需要注意以下几点:

import java.util.Scanner;

public class Excersice8 {
    public static void main(String arg[]) {
        String answer = null;
        Scanner input = new Scanner(System.in);

        while (!"Done".equals(answer));
        {
            System.out.println("Do you want to continue?");
            answer = input.nextLine();
            if (!"Done".equals(answer)) {
                System.out.println("Enter the value");
                char ch1 = input.next().charAt(0);
                System.out.println();
                if ((ch1 >= '0' && ch1 <= '9'))
                    System.out.println("Number ");
                else if ((ch1 >= 'a' && ch1 <= 'z'))
                    System.out.println("Small Character");
                else if ((ch1 >= 'A' && ch1 <= 'Z'))
                    System.out.println("Capital Character");
                else
                    System.out.println("Symbol");
            }
        }

        System.out.println("Thank you");
    }
}

结果:

create or replace procedure test_throw_an_error as buzz number; begin dbms_output.put_line('In test_throw_an_error. Now, to infinity!'); buzz:=1/0; end;
/
set serveroutput on
set feedback off
exec test_throw_an_error;
exec dbms_output.put_line('Done, with feedback off');
set feedback on
exec test_throw_an_error;
exec dbms_output.put_line('Done, with feedback on');