1

I am using Oracle and SQL Developer and I tried to code the function below. All is working fine, except for DBMS_OUTPUT.PUT_LINE. My console for output was activated in SQL Developer. My query was OK, all field are OK. Did the DBMS_OUTPUT.PUT_LINE work like this for a procedure?

CREATE OR REPLACE PROCEDURE sp_proc1 (pNoCmd number)
AS
vTotalCmd number;
BEGIN   
    SELECT s_ord.total INTO vTotalCmd FROM s_ord WHERE id = pNoCmd;
    DBMS_OUTPUT.PUT_LINE('Le total de la commande ' || pNoCmd || ' est ' || vTotalCmd || '$');
EXCEPTION
    WHEN NO_DATA_FOUND THEN
        DBMS_OUTPUT.PUT_LINE('Il n''y a pas de commande : ' || pNoCmd);
END;
/
CALL sp_proc1(97);

Anyone see error(s)?

6
  • What exactly doesn't work? Commented Oct 6, 2017 at 19:48
  • When I call my procedure with CALL, nothing print in my SGBD output in SQL developer Commented Oct 6, 2017 at 19:50
  • execute set serveroutput on first Commented Oct 6, 2017 at 19:51
  • You need to execute SET SERVEROUTPUT ON SIZE UNLIMITED first Commented Oct 6, 2017 at 19:51
  • Ok this work fine for the first time. But if I want to CALL another number in my procedure, using CALL sp_proc1(144), nothing was show.. :o Commented Oct 6, 2017 at 19:59

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.