title: PL/SQL calling a function inside a trigger
body: <p>I am trying to create a function using Oracle PL/SQL that stores the current date into a variable. This function will be called inside a trigger. The trigger (among other things) will insert this variable into a new table that has already been created. My code complies and runs without errors, but it doesn't work. Nothing happens. The trigger is an ON DELETE trigger, so when I delete one row from the original table, it just stays. Any clues what I am missing? Thank you.</p>
  
  <p>Function:</p>
  
  <pre><code>    CREATE OR REPLACE FUNCTION get_date (i_stdid archive_student.stdid%TYPE)
      RETURN date
      AS
         v_date DATE;
      BEGIN
         SELECT CURRENT_DATE INTO v_date FROM DUAL; 
      RETURN v_date;
      END;
  </code></pre>
  
  <p>Function call inside trigger:</p>
  
  <pre><code>    CREATE OR REPLACE TRIGGER ARCHIVE_DELETED_STUDENT
      AFTER DELETE ON STUDENT
      FOR EACH ROW
      DECLARE 
          v_date archive_student.change_date%TYPE;
      BEGIN
          -- other if statements here that are working properly
          v_date := get_date(:old.stdid);
          INSERT INTO archive_student (change_date) VALUES (v_date);
      END;
  </code></pre>