Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

SQL> desc x Name Null?

desc null sql type
0
Posted

SQL> desc x Name Null?

0

SQL*Plus shows the column as being nullable. But if we attempt to insert into table “X” we get: SQL> INSERT INTO x VALUES (NULL, NULL); INSERT INTO x VALUES (NULL, NULL) * ERROR at line 1: ORA-02290: check constraint (TEST.X_C01) violated SQL> So we have SQL*Plus [correctly] showing the column as being nullable, but when we attempt to insert NULLs into column “X”.”A” we get a constraint violation. Note however that it is a CHECK constraint and not a NOT-NULL constraint. • A foreign key is defined in the database with a delete rule of SET NULL but is shown in the schema report generated by TOYS (and generated DDL scripts) as having a delete rule of NO ACTION. Is this a bug? This particular problem is a bug in the USER_CONSTRAINTS catalog view (also DBA_ and ALL_) in Oracle 8.0 and 8i. This bug defines the delete rule as CASCADE or NO-ACTION. That is, the SET-NULL action was not decoded. This has been fixed in 9i. If you have the privilege SELECT ANY TABLE when capturing the schema meta-

0

SQL*Plus shows the column as being nullable. But if we attempt to insert into table “X” we get: SQL> INSERT INTO x VALUES (NULL, NULL); INSERT INTO x VALUES (NULL, NULL) * ERROR at line 1: ORA-02290: check constraint (TEST.X_C01) violated SQL> So we have SQL*Plus [correctly] showing the column as being nullable, but when we attempt to insert NULLs into column “X”.”A” we get a constraint violation. Note however that it is a CHECK constraint and not a NOT-NULL constraint. • A foreign key is defined in the database with a delete rule of SET NULL but is shown in the schema report generated by TOYS (and generated DDL scripts) as having a delete rule of NO ACTION. Is this a bug? This particular problem is a bug in the USER_CONSTRAINTS catalog view (also DBA_ and ALL_) in Oracle 8.0 and 8i. This bug defines the delete rule as CASCADE or NO-ACTION. That is, the SET-NULL action was not decoded. This has been fixed in 9i. If you have the privilege SELECT ANY TABLE when capturing the schema meta-

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.