Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Constraint implementation question
Dan,
It depends on what you want to achieve. If you want to ensure that everything in the column is in upper case, I'd suggest a pre-insert trigger to set the incoming value to upper(new_text). This way you will never have to worry about handling errors in any application sitting on top of the database. Alternatively you could use a check condition on the table, insisting that "new_text = upper(new_text)" which will raise an error if any lower case data is submitted. In a sense it depends on whether lower case has any meaning in your situation. If it does, but it's just not allowed then maybe the trigger is not so good.
Regards, David.
"Dan Hield @ home" wrote:
> I have an Oracle7 database on which I wish to enforce a table column to
> only
> contain upper case text. Can anyone tell me if this can be implemented
> declaratively or must it be done with the use of a trigger? Which ever
> the case,
> can you offer any suggestions that would help me do such a thing?
>
> Many thanks!
Received on Wed Dec 02 1998 - 00:51:14 CST
![]() |
![]() |