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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Triggers and default values problem

Re: Triggers and default values problem

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Mon, 18 Sep 2000 18:56:04 +0200
Message-ID: <969296381.26341.1.pluto.d4ee154e@news.demon.nl>

Why do it that way if you have the default value mechanism. The default value mechanism
- is definitely faster than your trigger - is declarative, so you won't have any *hardcoded* values in your trigger code.
If you really want to go the way you describe (which I don't recommend, the feature isn't available for nothing, it has been designed so you don't have to write code) you should remove the default value. IMO, however, you should reconsider.

Regards,

Sybrand Bakker, Oracle DBA

"Charles Bosquet" <cbosquet_at_free.fr> wrote in message news:carx5.949$F85.1278003_at_nnrp5.proxad.net...
> Hi,
>
> I have a table where MyField is a varchar2 with a default value = 'DEFAULT
> VALUE' :
> MyTable(..., MyField, ...)
>
> I have a trigger on MyTable on Before Insert :
> MyTrigger
>
> In my trigger i want to test if MyField is NULL when users insert rows in
> MyTable. But when i read :NEW.MyField, the field is never NULL because i
> give it a default value !!!
> I 'd like to give a default value to MyField and to know when it's NULL on
> before insert too ...
>
> Charles Bosquet APISoft FRANCE
>
>
>
Received on Mon Sep 18 2000 - 11:56:04 CDT

Original text of this message

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