[英]Oracle Insert returning ORA-01400
I am attempting the following SQL in an Oracle 11g DB, which returns 我正在尝试返回Oracle 11g数据库中的以下SQL
SQL Error: ORA-01400: cannot insert NULL into ("CRABERS"."AG_ASSET_REF"."CREATE_ID"). SQL错误:ORA-01400:无法插入NULL(“CRABERS”。“AG_ASSET_REF”。“CREATE_ID”)。
However, you can see that I am populating this column, which is formatted as number(38,0). 但是,您可以看到我正在填充此列,其格式为数字(38,0)。 As I am inserting a value, why else might I be receiving ORA-01400? 当我插入一个值时,为什么我可能会收到ORA-01400?
INSERT INTO ag_asset_ref
(asset_type_id,
create_id,
create_date,
file_size,
bus_unit_id,
status,
name)
VALUES ( 1050,
2458,
SYSDATE,
50000,
1000,
0,
'test insert' )
With this trigger your error appears: 使用此触发器,您的错误将显示
CREATE TRIGGER t_ag_asset_ref BEFORE INSERT OR UPDATE ON ag_asset_ref
FOR EACH ROW
BEGIN
:NEW.create_id := NULL;
END;
You case is probably not so simple but a trigger can certainly be the cause. 你的情况可能不那么简单,但触发器肯定是原因。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.