User Tools

Site Tools


kurs:select_into
PROCEDURE GET_SALARY
( p_last_name IN VARCHAR2, p_first_name in varchar2 ) AS
  v_salary number;
  v_department_name varchar2(50);
BEGIN
-- hier werden die felder selektiert
  select salary, department_name into v_salary, v_department_name
   from employees e, departments d
      where last_name       = p_last_name and
            first_name      = p_first_name and
            e.department_id = d.department_id;
  dbms_output.put_line(p_first_name||' '||
       p_last_name || ' verdient ' || v_salary ||' und arbeitet in ' ||
       v_department_name );
END GET_SALARY;
PROCEDURE hr.get_salary(
   p_last_name IN varchar2, p_salary OUT number)
as
  v_salary number;
BEGIN
  select salary into v_salary 
     from employees 
    where last_name = p_last_name;
  p_salary := v_salary;
  dbms_output.put_line(p_salary);
END;
kurs/select_into.txt · Last modified: 2014/09/10 21:22 (external edit)