into from employee where employeeidvmgrid

Into from employee where employeeidvmgrid

This preview shows page 1 - 3 out of 4 pages.

into v_mgr_name,v_mgr_job,v_mgr_date,v_mgr_pay from employee where employee_id=v_mgr_id; dbms_output.put_line('-------Manager--------'); dbms_output.put_line('name:'||lpad(v_mgr_name,20)); dbms_output.put_line('job title:'||lpad(v_mgr_job,20)); dbms_output.put_line('hire date:'||' '||to_char(v_mgr_date,'DD-MON- YYYY')); dbms_output.put_line('total pay:'||' '|| to_char(v_mgr_pay,'$99,990.00')); else dbms_output.put_line('-------Manager--------'); dbms_output.put_line('Name:'||'N/A'); dbms_output.put_line('job title:'||'N/A'); dbms_output.put_line('hire date:'||'N/A'); dbms_output.put_line('total pay:'||'N/A'); end if;
if v_dept_id is not null then select department_name into v_dept_name from department where department_id=v_dept_id; dbms_output.put_line('-------Department--------'); dbms_output.put_line('name:'||v_dept_name); dbms_output.put_line('department name:'||v_dept_name); select count(*) into v_emp_num from employee where department_id=v_dept_id; Dbms_output.put_line('number of employee:'||' '||to_char(v_emp_num)); else v_dept_name:='N/A'; v_emp_num:=0; dbms_output.put_line('-------Department--------'); dbms_output.put_line('Name:'||' '||v_dept_name); dbms_output.put_line('number of employee:'||to_char(v_emp_num)); end if; else dbms_output.put_line(to_char(v_input_emp_id)||'is not in the table.'); end if; if v_n!=0 then select Avg(salary+nvl(commission,0)) into v_com_total_pay from employee; dbms_output.put_line('-------Company--------'); dbms_output.put_line('avg total pay:'||to_char(v_com_total_pay,'$99,990.00')); else dbms_output.put_line('-------Company--------'); dbms_output.put_line('avg total pay:'||to_char(v_com_total_pay,'$99,990.00')); end if; end; 2) Accept p_1 prompt'please enter the department name: ' declare v_input_dept_name VARCHAR2(100) := '&p_1'; v_dept_id department.department_id%TYPE;

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture