Re: Not Null constraints

From: Michael Serbanescu <mserban>
Date: 1996/12/08
Message-ID: <58doc9$qmp_at_mtinsc01-mgt.ops.worldnet.att.net>#1/1


ORACLE enforces NOT NULL constraints as CHECK constraints, i.e. enforces such constraints as domain constraints. Therefore, the CONSTRAINT_TYPE in *_constraints tables (*=user/all/dba) is 'C', and the constraint name in 99% of the cases is SYSnn.., (i.e., the RDBMS gives the name) since I have yet to see an ORACLE site where the NOT NULL constraints are explicitly named. You would have to select the constraint name from the join of _constraints table with the _cons_columns table where column_name='..' and constraint_type='C' and table_name='..' <and owner='...', if using dba_ or all_) and search_condition like '%NOT NULL%' (I am not sure about the last condition, please check the _constraints tables).

I hope this helps.

Michael Serbanescu



John Parrott <spo_at_interlog.com> wrote:
>When doing an insert, how can I determine which fields is generating the
>'Not Null column is missing' error? Ideally I'd like to know the name
>of the integrity constraint which raised this message. I know that
>there may be multiple mandatory fields which are blank. I just want one.
>
>I've developed a package which formats error messages given an integrity
>constraint. Now all I need is a way to find the constraint. I'm ok for
>primary key and referential integrity constraints.
>
>When I get this working I might post a copy of this package.
>--
>John Parrott
>Elysium Financial Systems
>spo_at_interlog.com
>http://www.interlog.com/~spo
>
Received on Sun Dec 08 1996 - 00:00:00 CET

Original text of this message