title: pl/sql block to display employees information
body: <pre><code>ACCEPT p_1 PROMPT 'Please enter the last name:'
  DECLARE
  v_last_name VARCHAR2(20) := '&amp;p_1';
  v_Hire_date person.hire_date%TYPE;
  v_Job_type person.job_type%TYPE;
  v_Job_status person.Job_status%TYPE;
  v_pilot_type pilot.pilot_type%TYPE;
  v_n number;
  BEGIN
  select count(*) into v_n from person
  where UPPER(last_name) = v_last_name;
  IF v_n != 1 THEN
  DBMS_OUTPUT.PUT_LINE(TO_CHAR(v_last_name) || ' is not in the table. ');
  --ELSE 
  select UPPER(e.last_name),e.hire_date,e.job_type,e.job_status,
  p.pilot_type into v_last_name,v_hire_date,v_Job_type,v_Job_status,v_pilot_type
  from person e JOIN pilot p
  ON (e.person_id = p.person_id)
  order by last_name;
  DBMS_OUTPUT.PUT_LINE(RPAD('last_name',10) || RPAD('hire_date',10) ||
  RPAD('Job_type', 30) || RPAD('Job_status',10) || RPAD('pilot_type', 20));
  ELSE
     DBMS_OUTPUT.PUT_LINE('No output!');
  END IF;
  END;
  </code></pre>
  
  <p>I have written this code to display the employee information. The problem is in IF condition. It's not displaying the result.</p>
  
  <p>RESULT : 
  If I enter the user input last name as brown  it displays only this as below  </p>
  
  <blockquote>
    <p>brown is not in the table. </p>
  </blockquote>