0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

DB2(9.7)でCHAR型の列のサイズを変更する

Last updated at Posted at 2019-09-09

DB2(9.7)でCHAR型3桁の列のサイズを4桁にする必要があったのでコマンドをメモします

ALTER TABLE ALTER COLUMN SET DATA TYPEを使用して

ALTER TABLE {スキーマ名}.{テーブル名} ALTER COLUMN {カラム名} SET DATA TYPE CHAR(4);

再編成が必要な場合

REORG TABLE {テーブル名}

参考

ALTER TABLEの細かい仕様については以下のURLを参照しました。
https://www.ibm.com/support/knowledgecenter/ja/SSEPGG_9.7.0/com.ibm.db2.luw.sql.ref.doc/doc/r0000888.html

REORGの細かい仕様については以下のURLを参照しました。
https://www.ibm.com/support/knowledgecenter/ja/SSEPGG_9.7.0/com.ibm.db2.luw.admin.cmd.doc/doc/r0001966.html

0
0
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?