truncate table 文 ― 2007年03月28日 18時19分52秒
oracleにはtruncate table 文というのがあり、テーブルの全データを素早く削除することができますが、InformixもV10からこのtruncate table 文をサポートしてます。
% onstat -
IBM Informix Dynamic Server Version 10.00.FC6 -- On-Line -- Up 00:11:25 -- 39936 Kbytes
% dbaccess testdb -
Database selected.
> select count(*) from test_tbl;
(count(*))
28
1 row(s) retrieved.
> truncate table test_tbl;
Table truncated.
> select count(*) from test_tbl;
(count(*))
0 <<-- ゼロ件になっているのが確認できます
1 row(s) retrieved.
% onstat -
IBM Informix Dynamic Server Version 10.00.FC6 -- On-Line -- Up 00:11:25 -- 39936 Kbytes
% dbaccess testdb -
Database selected.
> select count(*) from test_tbl;
(count(*))
28
1 row(s) retrieved.
> truncate table test_tbl;
Table truncated.
> select count(*) from test_tbl;
(count(*))
0 <<-- ゼロ件になっているのが確認できます
1 row(s) retrieved.
最近のコメント