User Tools

Site Tools


kurs:insert
insert into emp_copy (
   employee_id,
   first_name,
   last_name,
   email,
   hire_date,
   job_id,
   department_id
  ) values (
   employees_seq.nextval,
   'Mark',
   'Hofstetter',
   'joeh',
   sysdate,
   'IT_PROG',
   (select department_id from departments where department_name = 'IT' )
   );

insert into emp_copy (
   employee_id,
   first_name,
   last_name,
   email,
   hire_date,
   job_id,
   department_id
  ) 
  select 
   employees_seq.nextval,
   first_name,
   last_name,
   email,
   sysdate,
   job_id,
   d.department_id 
   from departments d, employees e where department_name = 'IT' 
     and e.department_id = d.department_id
   ;

select employees_seq.currval from dual;


 select * from emp_copy where rownum =1  order by employee_id DESC
kurs/insert.txt · Last modified: 2014/09/10 21:22 (external edit)