title: Trigger with a function Oracle
body: <p>I need to make a trigger to insert 'A' in case of a approved student and 'R' for a not approved student. I need to use a function that returns 'A' or 'R'. Here is my function:</p>
  
  <pre><code>create or replace function check_grade
  (grade in number, frequency in number) return varchar2
  as 
  result varchar2(1) default '';
  begin
  if(grade&gt;=6) and (frequency&gt;=0.75)then
  result := 'A';
  else
  result := 'R';
  end if;
  return result;
  end;
  </code></pre>
  
  <p>And here is my trigger:</p>
  
  <pre><code>create or replace trigger situation
  before 
  insert on student
  for each row
  begin
  select check_grade(grade, frequency)
  into : new.situation
  from dual;
  end;
  </code></pre>
  
  <p>When I try to execute I always get an error. I don't have idea in what i can do!</p>