Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: "not null" as a default?

Re: "not null" as a default?

From: Jurij Modic <jmodic_at_src.si>
Date: Sun, 10 Jan 1999 22:40:16 GMT
Message-ID: <36992558.43983655@news.siol.net>


On Sun, 10 Jan 1999 11:02:03 -0500, Bruce Cota <bruce_at_vivi.com> wrote:

>This is probably an RTFM question but I can't find it:
>
>Is there away to make the default for every column "not null" instead
>of "null".
>
>That is, when I create a table, I would prefer to specify "null" only if
>the column permits
>null valubes, rather than "not null" for every column that does not
>permit null values.

The general answer is: NO, you can't. But you could wrap your "CREATE TABLE..." command into your own CRAETE_TABLE stored procedure, which will accept the actual create table command text and automaticaly apply NOT NULL constraint to any column that doesn't have "NULL" at the end of the collumn definition. You'll have to use dynamic SQL.

>Thanks in advance.

HTH, Jurij Modic <jmodic_at_src.si>
Certified Oracle7 DBA (OCP)



The above opinions are mine and do not represent any official standpoints of my employer Received on Sun Jan 10 1999 - 16:40:16 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US