DBMS输出未显示

时间:2019-04-30 18:12:34

标签: sql oracle oracle-sqldeveloper dbms-output

DBMS输出未显示

DECLARE
COUNT1 NUMBER;


BEGIN
    SELECT COUNT(*)
    INTO COUNT1
    FROM PROCESSPART
    WHERE DIV = '1'
     AND BK = '0G'
     AND BK_YR = '19';
  DBMS_OUTPUT.PUT_LINE('PROCESSPART RECORDS IN GEN5 FOR LOC 1, BK 0G, BK_YR 2019');
  DBMS_OUTPUT.PUT_LINE(COUNT1);

  END;

我已经在SQL Developer中打开了DBMS输出,并且该窗口在那里,已连接到DB。但是,当我运行该块时,成功完成后窗口中什么也没有出现。

1 个答案:

答案 0 :(得分:0)

在您的语句使用下面的指令之前(如OldProgrammmer所说)并一起运行它们:

SET serveroutput ON

DECLARE
COUNT1 NUMBER;


BEGIN
    SELECT COUNT(*)
    INTO COUNT1
    FROM PROCESSPART
    WHERE DIV = '1'
     AND BK = '0G'
     AND BK_YR = '19';
  DBMS_OUTPUT.PUT_LINE('PROCESSPART RECORDS IN GEN5 FOR LOC 1, BK 0G, BK_YR 2019');
  DBMS_OUTPUT.PUT_LINE(COUNT1);

END;