Re: Use a trigger to remove NULL values?
- From: Walt <walt_askier@xxxxxxxxxxxxxx>
- Date: Wed, 08 Feb 2006 12:12:38 -0500
CJ wrote:
I am having some issues with an application that enters NULL values to
an oracle 9.2 db. The application inserts multiple rows with NULL,
which are currently removed by using standard SQL (delete) on two
tables (table a contains the value, table b contains the relation).
I therefore wonder if this would be an appropriate place to use a
trigger?
If yes, any examples or suggestion on how to do this?
If no, what would be the appropriate way of automatic cleaning up this
problem? (I can not rewrite the application)
I'm not sure I understand the problem. Do you want the db to simply ignore those insert statements that contain nulls? Is every column null, or just some?
If you want the db to simply ignore insert statements containing nulls, a trigger would work. That's kind of odd behavior, though. If I issue an insert statement, I expect it to either insert a record or return an error. Failing silently is unusual behavior, but you can certainly implement it with a trigger.
Better to simply make a not null constraint, but if this breaks your app, the trigger might make sense. You can also set a default value for the column which would get rid of the nulls, but I'm not sure if this would be what you want.
//Walt
.
- Follow-Ups:
- References:
- Use a trigger to remove NULL values?
- From: CJ
- Use a trigger to remove NULL values?
- Prev by Date: Re: I have trouble with RECYCLE-BIN in 10g
- Next by Date: Re: Use a trigger to remove NULL values?
- Previous by thread: Re: Use a trigger to remove NULL values?
- Next by thread: Re: Use a trigger to remove NULL values?
- Index(es):
Relevant Pages
|
Loading