Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2005
    Posts
    14

    Unanswered: Check constraint for not null column

    Hi

    Oracle generates a check constraint for a not null column. Is there are anywhy to change this behavior ?

    For example, consider the following query :

    create table abc(a varchar(1) not null)

    For the above query, Oracle creates a check constraint for this. It adds an entry in user_constraints with the search_condition value set to ' "A" is not null '. I do not prefer to generate check constraint for not null columns. Is there anywhy to customize this behavior ?

    Thanks in advance.

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    How exactly would you like Oracle to check whether value inserted into column A is not null? I mean, what's wrong with this? "NOT NULL" is here just for your convenience; this could be done this way:
    Code:
    CREATE TABLE abc
    (a number NOT NULL,
     b number CHECK (b IS NOT NULL));
    Both work the same way, and both add a row into the user_constraints table.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •