Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2018
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. /*declare v_max_id employees.employee_id%type;
  2. begin
  3. select max(employee_id)+1 into v_max_id
  4. from employees;
  5. dbms_output.put_line(v_max_id);
  6. insert into employees(employee_id, last_name, email, hire_date, job_id)
  7. values (v_max_id, 'Kowalski', 'kowal1@op.pl', to_date('04-04-2014', 'dd-mm-yyyy'), 'IT_PROG');
  8. */
  9. declare v_dolna employees.salary%type:=&dolna;
  10. v_gorna employees.salary%type:=&gorna;
  11. v_id_od employees.department_id%type:=50;
  12. cursor kursor is select first_name, last_name, salary
  13. from employees
  14. where department_id = v_id_od;
  15. begin
  16. for rekord in kursor loop
  17. if rekord.salary between v_dolna and v_gorna then
  18. dbms_output.put_line(rekord.first_name ||' '|| rekord.last_name);
  19. end if;
  20. end loop;
  21. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement