IBM DB2 SQLCODE -407

遇到407 错误,说明正在有一个不为NULL的值没有被赋值。
例如:正要插入或者新增一条记录, 记录的某个字段为NULL,但数据库不允许这个字段为NULL,就会抛出407错误。

可以根据COLNO去查找哪个值出错。

例如:
NULL value to a NOT NULL column "TBSPACEID=23, TABLEID=3, COLNO=1" is not allowed.. SQLCODE=-407, SQLSTATE=23502, DRIVER


-407
AN UPDATE, INSERT, OR SET VALUE IS NULL, BUT THE OBJECT COLUMN column-name CANNOT CONTAIN NULL VALUES
Explanation
One of the following conditions occurred:
• A null insert or update value was specified for a column defined as NOT NULL.
• A SET transition variable statement specified a NULL value for column defined as NOT NULL without the WITH DEFAULT clause in the table definition.
• The update or insert value was DEFAULT, but the object column was declared as NOT NULL without WITH DEFAULT in the table definition. Consequently:
o A default value of NULL cannot be inserted into that column.
o An update cannot set default values of NULL in that column.
o A SET transition variable statement in a trigger cannot set default values of NULL in that column.
• The column name list for the INSERT statement omits a column declared NOT NULL and without WITH DEFAULT in the table definition.
• The view for the INSERT statement omits a column declared NOT NULL and without WITH DEFAULT in the base table definition.
• A null insert value was specified for a ROWID column.
System action
The statement cannot be processed. The 'column-name' might be returned in the SQLCA, depending on the syntax of the SQL statement in which the error was detected.
Programmer response
Examine the definition of the object table to determine which columns of the table have the NOT NULL attribute or have a type of ROWID, and correct the SQL statement accordingly.
SQLSTATE
23502
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值