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: Use a trigger to remove NULL values?

Re: Use a trigger to remove NULL values?

From: DA Morgan <damorgan_at_psoug.org>
Date: Mon, 13 Feb 2006 09:36:50 -0800
Message-ID: <1139852211.538363@jetspin.drizzle.com>


CJ wrote:
> First of all I would like to thank all of you for your answers and
> sorry regarding the late replay. I do agree that easiest way would be
> to "Fix the application. Treat the disease. Not the symptom." as
> mentioned by DA Morgan below. However, that is currently the problem. I
> do not have access to the source code, and it will take some time until
> I do have access to this.
>
> I do see the issue with "silent" deletion, which can create further
> issues in the future. I will therefore test and see if the NULL
> contraint breakes the application.
>
> Thanks again,
>
> Regards,
> CJ

Another possibility ... alter the tables to provide a DEFAULT similar to the following:

CREATE TABLE t (
col1 VARCHAR2(2),
col2 DATE DEFAULT SYSDATE NOT NULL);

INSERT INTO t (col1) VALUES ('ZZ');

SELECT * FROM t;

Note that no value was provided for col2.

-- 
Daniel A. Morgan
http://www.psoug.org
damorgan_at_x.washington.edu
(replace x with u to respond)
Received on Mon Feb 13 2006 - 11:36:50 CST

Original text of this message

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