title: calling a pl sql function issue
body: <p>Hello every one i just was told about this site today and i could use some help.
  I have read the rules and i understand what i am doing code wise well we just started Pl sql last week before that i had only done basic sql. but now i am stuck on calling the function i made :/ i feel silly. It is a fairly straight forward function and i am sure it is correct as my sql teacher said 'it looks good at a glance' but she did not show me how to call the functions and i really want to see if it working. </p>
  
  <p>I know how to call basic sql and functions  and pl sql with dbms.out but i draw a blank here, i remember her saying use <strong>1</strong> instead of employee_no in the select and its just two lines to call it please please can some one show me how to call what i made. I attached the ERD below too.</p>
  
  <p><strong><em>(a)  to calculate and return the total number of different task-types a given employee has worked on.</em></strong></p>
  
  <pre><code>SHOW ERRORS
  
  CREATE OR REPLACE FUNCTION task_types(eno employee.employee_no%TYPE)
    RETURN NUMBER IS
  
    task_var task.task_type_no%TYPE;
  
  
    BEGIN
      SELECT COUNT(DISTINCT t.task_type_no)
      INTO task_var
      FROM employee e, task t, assignment a
      WHERE e.employee_no = a.employee_no
            AND a.task_id = t.task_id
            AND e.employee_no = eno;
  
      RETURN task_var;
  
    END;
  </code></pre>
  
  <p>Entity-relational diagram:</p>
  
  <p><img src="https://i.stack.imgur.com/X0VaN.png" alt="the ERD"></p>
  
  <p>Thank you :)</p>