PL/SQL procedure succesfully completed but shows nothing

故事扮演 提交于 2019-12-02 16:46:26

问题


I've the following procedure code:

create or replace 
PROCEDURE Ventas_cliente( p_DNI IN CHAR )
IS

  CURSOR c_pedidos_clientes IS
  SELECT *
  FROM Pedidos_venta
  WHERE DNI_Cliente = p_DNI;

BEGIN
  DBMS_OUTPUT.PUT_LINE('test');
  FOR fila IN c_pedidos_clientes LOOP
    DBMS_OUTPUT.PUT_LINE(fila.OID_Pedido_venta||' '||fila.precio);
  END LOOP;
END Ventas_cliente;

When I type EXECUTE Ventas_(88441020); Oracle returns PL/SQL procedure succesfully completed. The great problem is that it'd return 'test'. Why does not Oracle return 'test'?


回答1:


You need to enable printing to stdout.

In SQL*Plus the simplest way of doing this is to use serveroutput:

set serveroutput on


来源:https://stackoverflow.com/questions/16591002/pl-sql-procedure-succesfully-completed-but-shows-nothing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!