(Oracle DB) - 20. COMMIT, ROLLBACK and TRUNCATE

kynoh·2023년 3월 26일
0

Oracle Database

목록 보기
24/30
/* 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
profile
On-orbit

0개의 댓글

관련 채용 정보