Home » RDBMS Server » Server Administration » upper
upper [message #374355] Thu, 07 June 2001 12:34 Go to next message
nandakumar
Messages: 5
Registered: October 2000
Junior Member
hi

is there any way to enforce conversion of data to upper case at the DDL definition of table?

something like ...

create table xyz ( three_letter_code varchar2(1) 'upper(three_letter_code)');

This could help
a) ensure data gets stored in uppercase
b) get rid of the upper() function from the applications.

Thanks
Re: upper [message #374359 is a reply to message #374355] Thu, 07 June 2001 14:47 Go to previous message
Jon
Messages: 483
Registered: May 2001
Senior Member
You could add a check constraint to ensure all upper data:

SQL> create table mytest
2 (field1 varchar2(3) check (substr(field1,1,1) between 'A' and 'Z'
3 and substr(field1,2,1) between 'A' and 'Z'
4 and substr(field1,3,1) between 'A' and 'Z'));

Table created.
Previous Topic: Synonm Creation Script
Next Topic: LONG type problem - ORA-01704: string literal too long
Goto Forum:
  


Current Time: Mon Jul 01 04:04:02 CDT 2024