From: Thomas J. Kyte <tkyte@us.oracle.com>
Subject: Re: Trigger question
Date: 2000/06/06
Message-ID: <8hjp5c$kr0$1@nnrp1.deja.com>#1/1
References: <393D4AB2.8E71E0BB@Unforgetable.com>
X-Http-Proxy: 1.0 x60.deja.com:80 (Squid/1.1.22) for client 205.227.43.13
Organization: Deja.com - Before you buy.
X-Article-Creation-Date: Tue Jun 06 21:07:08 2000 GMT
X-MyDeja-Info: XMYDJUIDtkyte
Newsgroups: comp.databases.oracle.misc
X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)


In article <393D4AB2.8E71E0BB@Unforgetable.com>,
  Walter T Rejuney <BlueSax@Unforgetable.com> wrote:
> Datebase: 8i Release 2
> OS: Solaris 2.6
>
> I have a column in a table that is defined as VARCHAR2(1). The legal
> values for this column are 'Y', 'N' or NULL and these are enforced by
 a
> check constraint.
>
> In most cases (about 80%) the column will have a 'N' and in my
> application a null will be treated as if it were a 'N'. That being the
> case I would like to do a pre-insert trigger which would intercept any
> 'N' value and insert a NULL instead so that in reality the table would
> only ever have a 'Y' or a NULL. Is it legal to do this in a trigger?
>

yes it is.

> The application folks already know that they must interpret a NULL
 just
> as if it were 'N', so I don't see any repercussions there, but are
 there
> other repercussions that I need to think about?
>

none that I can think of.

--
Thomas Kyte (tkyte@us.oracle.com) Oracle Service Industries
Howtos and such: http://osi.oracle.com/~tkyte/index.html
Oracle Magazine: http://www.oracle.com/oramag
Opinions are mine and do not necessarily reflect those of Oracle Corp


Sent via Deja.com http://www.deja.com/
Before you buy.


