---
title: "DB2 的CHECK不检查NULL值"
author: "luzl"
date: "2011-05-18T22:36:39Z"
tags: []
categories: ["数据库"]
slug: "db2-check-null"
draft: false
lastmod: "2011-05-18T22:36:39Z"
id: 1049252
url: "https://luzl.iteye.com/blog/1049252"
---

```java

Create table test.testchk(
col1 integer check(col1 in (1,2,3))
);
Insert into test.testchk(col1) values(null);

```

执行成功了，大家想想这是不是bug啊。