Oracle Modify语句 - 错误

1 oracle

我在表格中添加了一个新列.

ALTER TABLE neue_buch modify preis not null;
Run Code Online (Sandbox Code Playgroud)

我有这个错误:

Error starting at line 40 in command:
ALTER TABLE neue_buch
modify preis not null
Error report:
SQL Error: ORA-02296: cannot enable (S1885872.) - null values found
02296. 00000 - "cannot enable (%s.%s) - null values found"
*Cause:    an alter table enable constraint failed because the table
           contains values that do not satisfy the constraint.
*Action:   Obvious
Run Code Online (Sandbox Code Playgroud)

我的修改声明有什么问题.

提前谢谢了,

magidu

Jus*_*ave 5

该错误消息告诉你,有一些行NEUE_BUCH,其中PREIS列是NULL.在创建此NOT NULL约束之前,您需要将这些行修改为具有非NULL值.