PL/SQL Using Sequence in Insert Command


declare
  v_last_name employees.last_name%type;
  v_hire_date employees.hire_date%type;
begin
  select user, sysdate
  into v_last_name, v_hire_date
  from dual;
    insert into employees
    (
      employee_id,
      first_name,
      last_name,
      email,
      hire_date,
      job_id
    )
    values
    (
      seq_employee_id.nextval,
      'Test',
      v_last_name,
      'test@xyz.com',
      v_hire_date,
      'IT_PROG'
    );
end;


select * from employees where job_id like '%IT%';
insert into employees
(
  employee_id,
  first_name,
  last_name,
  email,
  hire_date,
  job_id
)
values
(
  seq_employee_id.nextVal,
  'Nurhak',
  'KAYA',
  'nurhak.kaya@xyz.com',
  sysdate,
  'IT_PROG'
);

Comments

Popular posts from this blog

Solution for the fault: "System.Diagnostics.Process.Start is not working on IIS, but working on ASP.NET Development Server"

Solution for "Can not obtain Oracle client information from registry"