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.
コメント
トラックバック
このエントリのトラックバックURL: http://in4mix.asablo.jp/blog/2007/03/28/1351716/tb
※なお、送られたトラックバックはブログの管理者が確認するまで公開されません。
コメントをどうぞ
※メールアドレスとURLの入力は必須ではありません。 入力されたメールアドレスは記事に反映されず、ブログの管理者のみが参照できます。
※なお、送られたコメントはブログの管理者が確認するまで公開されません。