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: using nvl when insert or update

Re: using nvl when insert or update

From: Niall Litchfield <n-litchfield_at_audit-commission.gov.uk>
Date: Tue, 12 Mar 2002 10:15:30 -0000
Message-ID: <3c8dd54b$0$8514$ed9e5944@reading.news.pipex.net>


or even better alter table mytable modify (mycolumn not null default 0); this gives the optimiser more info about the data in the field, this is of particular relevance when choosing index access path.

--
Niall Litchfield
Oracle DBA
Audit Commission UK
*****************************************
Please include version and platform
and SQL where applicable
It makes life easier and increases the
likelihood of a good answer

******************************************
"damorgan" <damorgan_at_exesolutions.com> wrote in message
news:3C8CEA98.43F24FA2_at_exesolutions.com...

> ALTER TABLE mytable
> MODIFY (mycolumn DEFAULT 0);
>
> No triggers, no NVL, no code, no hassles.
>
> Daniel Morgan
>
>
>
> Ryan Gaffuri wrote:
>
> > I know I can do this if I explicitly call it, but Id like to automate
> > it.
> >
> > If for some reason someone adds a null value to a field, Id like to
> > change it with a nvl to 0. I dont want an error to come back. The
> > field will be in the same table that is being inserted or updated so I
> > cant use a trigger.
> >
> > Anyway to automate this?
>
Received on Tue Mar 12 2002 - 04:15:30 CST

Original text of this message

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