Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: "not null" as a default?
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)
![]() |
![]() |