How do you set a field to allow null values in DB2?

In DB2, you can use the following syntax to set a field to allow null values:

ALTER TABLE 表名 ALTER COLUMN 列名 SET NULL

For example, to set the field “column_name” in the table to allow null values, you can execute the following command:

ALTER TABLE table_name ALTER COLUMN column_name SET NULL

Please make sure to replace “table_name” with the actual table name and “column_name” with the actual column name in the command above.

Leave a Reply 0

Your email address will not be published. Required fields are marked *


广告
Closing in 10 seconds
bannerAds