insert into employees
(
employee_id,
first_name,
last_name,
email,
hire_date,
job_id
)
values
(
seq_employee_id.nextval,
'Nurhak',
'Kaya',
'[email protected]',
sysdate,
'IT_PROG'
);
savepoint point1;
insert into employees
(
employee_id,
first_name,
last_name,
email,
hire_date,
job_id
)
values
(
seq_employee_id.nextval,
'Nurhak',
'Kaya',
'[email protected]',
sysdate,
'IT_PROG'
);
savepoint point2;
insert into employees
(
employee_id,
first_name,
last_name,
email,
hire_date,
job_id
)
values
(
seq_employee_id.nextval,
'Nurhak3',
'Kaya',
'[email protected]',
sysdate,
'IT_PROG'
);
savepoint point3;
--ROLLBACK!!
select * from employees
where email='[email protected]'; --Data has been found!
rollback to savepoint point2; --'Rollback to savepoint point2' command has undone the last
--inserted data.
select * from employees
where email='[email protected]'; --Last inserted data can not be seen anymore!
Comments
Post a Comment