sql - ora-30667 不能在空列的默认值上删除非空约束

标签 sql oracle oracle12c

首先,我感谢任何帮助,并对我的英语感到抱歉。
我是一名学生,我的老师为我创建了一个架构,因此我可以使用 Oracle 数据库。它运行良好,但今天我删除了一些表并添加了其他表,当我尝试在新表中插入某些内容时,它给了我一个错误:

ora-30667 cannot drop not null constraint on a default on null column


我读了一些有关该错误的内容,有些人说要清除回收站,但这对我不起作用;它仍然给我那个错误。
即使是一个简单的例子也给了我错误:
create table example(example_id number(10), example_name varchar(255));
insert into example(example_id, example_name) values(1, 'example');
请帮助我,我必须做这项工作,但那个错误并没有让我去做。
Oracle 版本:Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64 位生产
版:
我试过这个,作为一个完整的例子:
create table tipo_funcionario(
id_tipo_funcionario number(10),
descricao varchar(255)
);

insert into tipo_funcionario(id_tipo_funcionario, descricao) values(1, 'gestor');
我执行它说:
insert into tipo_funcionario(id_tipo_funcionario, descricao) values(1, 'gestor')

Error report - 

SQL Error: ORA-00604: error occurred at recursive sql level 1


ORA-30667: cannot drop not null constraint on a default on null column

00604. 00000 -  "error occurred at recursive SQL level %s"

*Cause:    An error occurred while processing a recursive SQL statement
           (a statement applying to internal dictionary tables).

*Action:   If the situation described in the next error on the stack
           can be corrected, do so; otherwise contact Oracle Support.

最佳答案

我不知道它是否仍然相关 - 但如果它是:
如果您可以使用简单的命令行工具(例如 SQL Plus)重试插入,例如我相信你不会得到那个错误。
似乎您使用的是具有“免费 SQL”区域的 GUI 工具,并且在执行之前没有标记插入命令的特定文本,也没有使用半列或任何其他编辑器分隔符分隔不同的命令。

关于sql - ora-30667 不能在空列的默认值上删除非空约束,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34300909/

相关文章:

oracle - 如何在 Docker Oracle 12 中执行 sql 文件?

SQL字符串添加问题

mysql - 在sql中组合多个计数查询

oracle - Oracle 10g 上的独占表(读)锁?

regex - Oracle查询查找不包含字符的字符串

database - Oracle:转储文件可能是数据泵导出转储文件

python - 将多个值插入数据库

MySQL 查询选择所需的最后一个日期,但具有与该日期根本不相关的不同列值

sql - FORALL 与 FOR 批量更新

python - SQLAlchemy 中是否有等效的 LISTAGG WITHIN GROUP?