DBMS_OUTPUTを使いデバッグする

Pocket

/*
|| DBMS_OUTPUTを使いデバッグする
|| NVL関数 :NVL(列1, 0) 列1がNULLの場合0とする
|| DBMS_OUTPUT :DBMS_OUTPUT.PUT_LINE(表示内容(文字列、式))
*/
CREATE OR REPLACE PROCEDURE debug_test
IS
sal_col emp.sal%TYPE;
comm_col emp.comm%TYPE;
total_sal emp.sal%TYPE;
BEGIN
SELECT sal. NVL(comm, 0) INTO sal_col, comm_col FROM emp
WHERE empno = 7369;
total_sal := sal_col + comm_col;
DBMS_OUTPUT.PUT_LINE(‘total_sal: ‘||total_sal);
END;
/

以上です (^^♪