刚有人问我,
TRCUNCATE是DML还是DDL呢?我的理解是,DDL操作不管失败还是成功,都会执行COMMIT操作,而DML操作则不会,那简单做个测试吧
Connected to Oracle Database 11g Enterprise Edition Release 11.1.0.6.0
Connected as jhf
SQL> create table t(id number);
Table created
SQL> insert into t select 1 from dual;
1 row inserted
SQL> truncate table tfsfs;
truncate table tfsfs
ORA-00942: 表或视图不存在
新开一个SESSION
Connected to Oracle Database 11g Enterprise Edition Release 11.1.0.6.0
Connected as jhf
SQL> select * from t;
ID
----------
1
之前的INSERT操作已被提交了, 由此可见TRUNCATE是DDL操作。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/13515865/viewspace-558092/
,如需转载,请注明出处,否则将追究法律责任。