title: write a PLSQL block which will throw an exception if there is no record available in department table for the dept_id in emp table
body: <p>schema details:</p>
  <pre><code>Table   columns
  dept    dept_head, dept_id,dept_name  ::::::
  emp     dept_id, emp_id,emp_lname, emp_status, loc_id, ...
  </code></pre>
  <p>output format:</p>
  <pre><code>Dept ID :**** is not a valid ID
  </code></pre>
  <p>I have tried with this code in HackerRank, getting the desired output still not able to pass the testcase. it says incorrect answer, testcase 0 failed. can anyone suggest me where i am making mistake and help me in passing the testcase.</p>
  <pre><code>set serveroutput on;
  declare
  DEPTID emp.DEPT_ID%type:=123;
  DEPTNAME dept.DEPT_NAME%type;
  DEPTHEAD dept.DEPT_HEAD%type;
  begin
  select DEPT_ID,DEPT_NAME,DEPT_HEAD into DEPTID,DEPTNAME,DEPTHEAD from dept where DEPT_ID=DEPTID;
  DBMS_OUTPUT.PUT_LINE (DEPTID || DEPTNAME || DEPTHEAD);
  Exception
      WHEN NO_DATA_FOUND THEN
        dbms_output.put_line('Dept ID :'||DEPTID||' is not a valid ID');  
  END;
  /
  exit;
  </code></pre>