User Tools

Site Tools


kurs:upsert_emp

This is an old revision of the document!


PROCEDURE upsert_salary
   ( p_first_name IN VARCHAR2,
     p_last_name  IN VARCHAR2,
     p_salary     IN number)
   IS
BEGIN
  begin
  insert into emp (first_name, last_name, salary)
    values (p_first_name, p_last_name, p_salary);
  exception
    when DUP_VAL_ON_INDEX then
      update emp set salary = p_salary where
        first_name = p_first_name and
        last_name  = p_last_name;
    when others then
       dbms_output.put_line('Fehler '||SQLERRM);
  end;
  
  begin 
  null;
  end;
END; -- Procedure
kurs/upsert_emp.1410376975.txt.gz · Last modified: 2014/11/11 09:03 (external edit)