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)?

SurveyVisual
  • 27
  • 1
  • 8

0 Answers0