This discussion is archived
6 Replies Latest reply: May 5, 2013 4:29 AM by 1006261 RSS

PLSQL

1006261 Newbie
Currently Being Moderated
Hello everyone .

I have this code. The problem is when I insert not correct EMP_NUM , there is an error which is no data found "ORA-01403: no data found" but I want display messge that says EMP_num Is not in the database.


CREATE OR REPLACE PROCEDURE new_drive(TMP_EM_NUM IN NUMBER ) AS
BEGIN
DECLARE
emp_id NUMBER;
trk_id NUMBER;
BEGIN
SELECT emp_num
INTO EMP_ID
FROM employee
WHERE EMP_NUM=TMP_EM_NUM;
IF EMP_ID IS NULL THEN
Dbms_Output.put_line('that the employee was not found and do not perform any of the following steps');
ELSE
Dbms_Output.put_line('that the employee was found');
END IF ;
END;
END;
/

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points