NULL Constraints Missing

I am working with Oracle 8i and created a simple table with three columns (two columns with NOT NULL constraints and the remaining column with a NULL constraint). I then did a select from user_constraints and only the NOT NULL constraints where returned. Any idea why the NULL constraint does not show up?

Answer Wiki

NOT NULL as a real constraint indicating the column can never be empty

NULL is not a constraint. Using the NULL in your table definition doesn’t show up NULL when you do a describe from your table. The keyword NULL is just ignored… and NULL means “it can be empty yes or no”, so this includes ALL situations without any constraint.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy

Processing your response...

Discuss This Question: 3 &nbspReplies

There was an error processing your information. Please try again later.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy

As far as I know there is no such thing as a NULL constraint. What would be the point of creating a column on a table and then saying it must always be empty and never have a value. There is just no point in having such a column in the first place, sureley?

Hi,
This is true. I think this happens because defining a column as NULL does not impose in fact any restriction upon
the column, therefore it is not considered a constraint.
As per the documentation, you may indeed give it a
constraint name of yours, however, from the database point
of view it is not a constraint.
At the data dictionary level, the table USER_TAB_COLUMNS
still contains a NULLABLE column, which in fact stores
the column's NULL or NOT NULL definition, and this column
already existed in the older versions of Oracle, before
the CONSTRAINT was part of the syntax at all.
Hope this could be a suggestion, if not a full explanation.
Best rgds,
Iudith Mentzel

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy

Processing your reply...

Ask a Question

Free Guide: Managing storage for virtual environments

Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!

To follow this tag...

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States.
Privacy