/* COMMIT, ROLLBACK and TRUNCATE */
/*
# Executions of UPDATE, INSERT, MERGE, DELETE change values.
# However, the changed values are not stored permanently.
*/
/* Formats of COMMIT and ROLLBACK */
COMMIT [Work] [TO SAVE POINT savepoint_name];
ROLLBACK [Work] [TO SAVE POINT savepoint_name];
/* Test of Commit, Rollback and Truncate */
CREATE TABLE ex3_4
(
employee_id NUMBER
);
INSERT INTO ex3_4
VALUES
(100);
SELECT *
FROM ex3_4;
-- Select this table again in SQL Plus, 'No rows selected'
COMMIT; -- Commit coplete.
--ROLLBACK;
/* TRUNCATE */
-- Query of DDL (Rollback doesn't work)
-- WHERE can not be added
TRUNCATE TABLE ex3_4; -- Table EX3_4 truncated