在dataGrip中直接 使用 set serverout on 后
调用存储过程也是无法再控制台中看到输出。
解决方案:在控制台点一下这个图标
然后就能看到输出了。
创建存储过程的语句:
create procedure SP_emp
as
--声明变量
V_sal number(20,2);
begin
--SQL语句的操作 select ... into ....from ... where ...
select SALARY into V_sal from EMPLOYEES where EMPLOYEE_ID=100;
--打印
DBMS_OUTPUT.PUT_line(V_sal);
end;