NULL Constraints Missing

0 pts.
Tags:
SQL
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?
ASKED: January 18, 2005  7:00 PM
UPDATED: January 19, 2005  8:30 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.

as far as i know :

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.

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
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
  • Annbuck
    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?
    0 pointsBadges:
    report
  • Welcome
    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
    0 pointsBadges:
    report
  • Spanayotov
    Because a "Null constraint" is not a constraint at all. The column may have values, or may have nulls.
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

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

REGISTER or login:

Forgot Password?
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

Thanks! We'll email you when relevant content is added and updated.

Following