Question: Why do I get this message: NO DATA FOUND. PL/SQL procedure successfully completed. SQL*Plus: Release 11.2.0.1.0 Production on Sun Oct 14 07:15:15 2018 Copyright (c)

Why do I get this message:

NO DATA FOUND.

PL/SQL procedure successfully completed.

SQL*Plus: Release 11.2.0.1.0 Production on Sun Oct 14 07:15:15 2018

Copyright (c) 1982, 2010, Oracle. All rights reserved.

Enter user-name: system/Oracle27

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> SET ECHO ON SQL> SPOOL f:\cs422a\wa7spool.txt SQL> START f:\cs422a\wa7.txt SQL> SET SERVEROUT ON SQL> DECLARE 2 EMP_REC HR.EMPLOYEES%ROWTYPE; 3 4 BEGIN 5 SELECT * 6 INTO EMP_REC 7 FROM HR.EMPLOYEES 8 WHERE EMPLOYEE_ID = 5; 9 10 IF EMP_REC.EMPLOYEE_ID = 5 THEN 11 DBMS_OUTPUT.PUT_LINE ('EMPLOYEE_ID: ' || EMP_REC.EMPLOYEE_ID) ; 12 DBMS_OUTPUT.PUT_LINE ('FIRST_NAME: ' || EMP_REC.FIRST_NAME) ; 13 DBMS_OUTPUT.PUT_LINE ('LAST_NAME: ' || EMP_REC.LAST_NAME) ; 14 DBMS_OUTPUT.PUT_LINE ('SALARY: ' || TO_CHAR (EMP_REC.SALARY, '$999,999')); 15 END IF; 16 EXCEPTION 17 WHEN NO_DATA_FOUND THEN 18 DBMS_OUTPUT.PUT_LINE ('NO DATA FOUND.'); 19 20 END; 21 / NO DATA FOUND.

PL/SQL procedure successfully completed.

SQL>

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!