title: Use of boolean in PL/SQL
body: <p>I have a function in PL/SQL which checks if a particular <code>emp_id</code> exists or not which is:</p>
  
  <pre><code>CREATE OR REPLACE FUNCTION checkEmpNo(eno numeric)
  RETURN boolean IS
      emp_number number;
  BEGIN
      SELECT emp_id INTO emp_number
      FROM emp;
      IF eno=emp_number
      THEN
          return true;
      ELSE
          return false;
      END IF;
  END checkEmpNo;
  </code></pre>
  
  <p>The function compiles successfully, but when I try to run it as:</p>
  
  <pre><code>DECLARE
      exist boolean;
  BEGIN
      exist=checkEmpNo(1);
      dbms_output.put_line(exist);
  END;
  </code></pre>
  
  <p>it returns the error: </p>
  
  <pre><code>ORA-06550: line 5, column 1:
  PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'
  ORA-06550: line 5, column 1:
  PL/SQL: Statement ignored
  
  3. BEGIN
  4. exist:=checkEmpNo(1);
  5. dbms_output.put_line(exist);
  6. END;
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>I also tried this:</p>
  
  <pre><code>DECLARE
      exist boolean:=true;
  BEGIN
      if(exist=checkEmpNo(1))
      then
          dbms_output.put_line('true');
      else
          dbms_output.put_line('false');
      end if;
  END;
  </code></pre>
  
  <p>And it returns the error: <code>ORA-01422: exact fetch returns more than requested number of rows</code></p>