Take a look at the following SQL statements...
Select * from employee; -- the table has 1000 records
Insert into employee(emp_id,emp_name,salary)
values('E_101','Susil Kumar',20000);
Insert into employee(emp_id,emp_name,salary)
values('E_102','Sukumar',20000);
Insert into employee(emp_id,emp_name,salary)
values('E_103','Ramuk Lisus',10000);
-- We have not committed the inserts yet
create table employee
as
Select * from employee; -- errors out with exception 'name is already used by an existing object'
rollback; -- We are trying to roll back the data insert operation
Select * from employee where emp_id='E_102'; -- This query returns row though we didnt explicitly commit the changes. It is because we ran Create table statement ( DDL ) which did the trick and ran a commit on this session ....
Conclusion : Be careful when writing DDL statements in a session. Make sure you have rolled back the changes if need be.
Select * from employee; -- the table has 1000 records
Insert into employee(emp_id,emp_name,salary)
values('E_101','Susil Kumar',20000);
Insert into employee(emp_id,emp_name,salary)
values('E_102','Sukumar',20000);
Insert into employee(emp_id,emp_name,salary)
values('E_103','Ramuk Lisus',10000);
-- We have not committed the inserts yet
create table employee
as
Select * from employee; -- errors out with exception 'name is already used by an existing object'
rollback; -- We are trying to roll back the data insert operation
Select * from employee where emp_id='E_102'; -- This query returns row though we didnt explicitly commit the changes. It is because we ran Create table statement ( DDL ) which did the trick and ran a commit on this session ....
Conclusion : Be careful when writing DDL statements in a session. Make sure you have rolled back the changes if need be.
Comments