dbTalk Databases Forums  

9i: Check- constraint Upper(Column)

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss 9i: Check- constraint Upper(Column) in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Andreas Mosmann
 
Posts: n/a

Default 9i: Check- constraint Upper(Column) - 04-02-2008 , 04:19 AM






Hi newsgroup,

Is it possible to build a constraint, that ensures, that there are not
more entries in a column, that look like
'Abc ' -> trim(upper(..))='ABC'
'ABC' -> trim(upper(..))='ABC'
'aBC ' -> trim(upper(..))='ABC'
?

Alternativ I could build a shadow column filled by a trigger that
containes trim(upper(..)) and a check constraint on this, but it seems
to me that there is a better way.

Thank you in advance
Andreas Mosmann

--
wenn email, dann AndreasMosmann <bei> web <punkt> de

Reply With Quote
  #2  
Old   
Carlos
 
Posts: n/a

Default Re: 9i: Check- constraint Upper(Column) - 04-02-2008 , 08:24 AM






On 2 abr, 11:19, Andreas Mosmann <mosm... (AT) expires-30-04-2008 (DOT) news-
group.org> wrote:
Quote:
Hi newsgroup,

Is it possible to build a constraint, that ensures, that there are not
more entries in a column, that look like
'Abc * ' -> trim(upper(..))='ABC'
'ABC' * *-> trim(upper(..))='ABC'
'aBC ' * -> trim(upper(..))='ABC'
?

Alternativ I could build a shadow column filled by a trigger that
containes trim(upper(..)) and a check constraint on this, but it seems
to me that there is a better way.

Thank you in advance
Andreas Mosmann

--
wenn email, dann AndreasMosmann <bei> web <punkt> de
Not sure about what you're trying to do, but a Function Based Unique
Index on (trim(upper(column))) may do the trick...

HTH.

Cheers.

Carlos.


Reply With Quote
  #3  
Old   
Carlos
 
Posts: n/a

Default Re: 9i: Check- constraint Upper(Column) - 04-02-2008 , 08:24 AM



On 2 abr, 11:19, Andreas Mosmann <mosm... (AT) expires-30-04-2008 (DOT) news-
group.org> wrote:
Quote:
Hi newsgroup,

Is it possible to build a constraint, that ensures, that there are not
more entries in a column, that look like
'Abc * ' -> trim(upper(..))='ABC'
'ABC' * *-> trim(upper(..))='ABC'
'aBC ' * -> trim(upper(..))='ABC'
?

Alternativ I could build a shadow column filled by a trigger that
containes trim(upper(..)) and a check constraint on this, but it seems
to me that there is a better way.

Thank you in advance
Andreas Mosmann

--
wenn email, dann AndreasMosmann <bei> web <punkt> de
Not sure about what you're trying to do, but a Function Based Unique
Index on (trim(upper(column))) may do the trick...

HTH.

Cheers.

Carlos.


Reply With Quote
  #4  
Old   
Carlos
 
Posts: n/a

Default Re: 9i: Check- constraint Upper(Column) - 04-02-2008 , 08:24 AM



On 2 abr, 11:19, Andreas Mosmann <mosm... (AT) expires-30-04-2008 (DOT) news-
group.org> wrote:
Quote:
Hi newsgroup,

Is it possible to build a constraint, that ensures, that there are not
more entries in a column, that look like
'Abc * ' -> trim(upper(..))='ABC'
'ABC' * *-> trim(upper(..))='ABC'
'aBC ' * -> trim(upper(..))='ABC'
?

Alternativ I could build a shadow column filled by a trigger that
containes trim(upper(..)) and a check constraint on this, but it seems
to me that there is a better way.

Thank you in advance
Andreas Mosmann

--
wenn email, dann AndreasMosmann <bei> web <punkt> de
Not sure about what you're trying to do, but a Function Based Unique
Index on (trim(upper(column))) may do the trick...

HTH.

Cheers.

Carlos.


Reply With Quote
  #5  
Old   
Carlos
 
Posts: n/a

Default Re: 9i: Check- constraint Upper(Column) - 04-02-2008 , 08:24 AM



On 2 abr, 11:19, Andreas Mosmann <mosm... (AT) expires-30-04-2008 (DOT) news-
group.org> wrote:
Quote:
Hi newsgroup,

Is it possible to build a constraint, that ensures, that there are not
more entries in a column, that look like
'Abc * ' -> trim(upper(..))='ABC'
'ABC' * *-> trim(upper(..))='ABC'
'aBC ' * -> trim(upper(..))='ABC'
?

Alternativ I could build a shadow column filled by a trigger that
containes trim(upper(..)) and a check constraint on this, but it seems
to me that there is a better way.

Thank you in advance
Andreas Mosmann

--
wenn email, dann AndreasMosmann <bei> web <punkt> de
Not sure about what you're trying to do, but a Function Based Unique
Index on (trim(upper(column))) may do the trick...

HTH.

Cheers.

Carlos.


Reply With Quote
  #6  
Old   
fitzjarrell@cox.net
 
Posts: n/a

Default Re: 9i: Check- constraint Upper(Column) - 04-02-2008 , 09:22 AM



On Apr 2, 8:24*am, Carlos <miotromailcar... (AT) netscape (DOT) net> wrote:
Quote:
On 2 abr, 11:19, Andreas Mosmann <mosm... (AT) expires-30-04-2008 (DOT) news-





group.org> wrote:
Hi newsgroup,

Is it possible to build a constraint, that ensures, that there are not
more entries in a column, that look like
'Abc * ' -> trim(upper(..))='ABC'
'ABC' * *-> trim(upper(..))='ABC'
'aBC ' * -> trim(upper(..))='ABC'
?

Alternativ I could build a shadow column filled by a trigger that
containes trim(upper(..)) and a check constraint on this, but it seems
to me that there is a better way.

Thank you in advance
Andreas Mosmann

--
wenn email, dann AndreasMosmann <bei> web <punkt> de

Not sure about what you're trying to do, but a Function Based Unique
Index on (trim(upper(column))) may do the trick...

HTH.

Cheers.

Carlos.- Hide quoted text -

- Show quoted text -
A check constraint can be written using the upper() function. I've
done that before and it works without issue.


David Fitzjarrell


Reply With Quote
  #7  
Old   
fitzjarrell@cox.net
 
Posts: n/a

Default Re: 9i: Check- constraint Upper(Column) - 04-02-2008 , 09:22 AM



On Apr 2, 8:24*am, Carlos <miotromailcar... (AT) netscape (DOT) net> wrote:
Quote:
On 2 abr, 11:19, Andreas Mosmann <mosm... (AT) expires-30-04-2008 (DOT) news-





group.org> wrote:
Hi newsgroup,

Is it possible to build a constraint, that ensures, that there are not
more entries in a column, that look like
'Abc * ' -> trim(upper(..))='ABC'
'ABC' * *-> trim(upper(..))='ABC'
'aBC ' * -> trim(upper(..))='ABC'
?

Alternativ I could build a shadow column filled by a trigger that
containes trim(upper(..)) and a check constraint on this, but it seems
to me that there is a better way.

Thank you in advance
Andreas Mosmann

--
wenn email, dann AndreasMosmann <bei> web <punkt> de

Not sure about what you're trying to do, but a Function Based Unique
Index on (trim(upper(column))) may do the trick...

HTH.

Cheers.

Carlos.- Hide quoted text -

- Show quoted text -
A check constraint can be written using the upper() function. I've
done that before and it works without issue.


David Fitzjarrell


Reply With Quote
  #8  
Old   
fitzjarrell@cox.net
 
Posts: n/a

Default Re: 9i: Check- constraint Upper(Column) - 04-02-2008 , 09:22 AM



On Apr 2, 8:24*am, Carlos <miotromailcar... (AT) netscape (DOT) net> wrote:
Quote:
On 2 abr, 11:19, Andreas Mosmann <mosm... (AT) expires-30-04-2008 (DOT) news-





group.org> wrote:
Hi newsgroup,

Is it possible to build a constraint, that ensures, that there are not
more entries in a column, that look like
'Abc * ' -> trim(upper(..))='ABC'
'ABC' * *-> trim(upper(..))='ABC'
'aBC ' * -> trim(upper(..))='ABC'
?

Alternativ I could build a shadow column filled by a trigger that
containes trim(upper(..)) and a check constraint on this, but it seems
to me that there is a better way.

Thank you in advance
Andreas Mosmann

--
wenn email, dann AndreasMosmann <bei> web <punkt> de

Not sure about what you're trying to do, but a Function Based Unique
Index on (trim(upper(column))) may do the trick...

HTH.

Cheers.

Carlos.- Hide quoted text -

- Show quoted text -
A check constraint can be written using the upper() function. I've
done that before and it works without issue.


David Fitzjarrell


Reply With Quote
  #9  
Old   
fitzjarrell@cox.net
 
Posts: n/a

Default Re: 9i: Check- constraint Upper(Column) - 04-02-2008 , 09:22 AM



On Apr 2, 8:24*am, Carlos <miotromailcar... (AT) netscape (DOT) net> wrote:
Quote:
On 2 abr, 11:19, Andreas Mosmann <mosm... (AT) expires-30-04-2008 (DOT) news-





group.org> wrote:
Hi newsgroup,

Is it possible to build a constraint, that ensures, that there are not
more entries in a column, that look like
'Abc * ' -> trim(upper(..))='ABC'
'ABC' * *-> trim(upper(..))='ABC'
'aBC ' * -> trim(upper(..))='ABC'
?

Alternativ I could build a shadow column filled by a trigger that
containes trim(upper(..)) and a check constraint on this, but it seems
to me that there is a better way.

Thank you in advance
Andreas Mosmann

--
wenn email, dann AndreasMosmann <bei> web <punkt> de

Not sure about what you're trying to do, but a Function Based Unique
Index on (trim(upper(column))) may do the trick...

HTH.

Cheers.

Carlos.- Hide quoted text -

- Show quoted text -
A check constraint can be written using the upper() function. I've
done that before and it works without issue.


David Fitzjarrell


Reply With Quote
  #10  
Old   
Andreas Mosmann
 
Posts: n/a

Default Re: 9i: Check- constraint Upper(Column) - 04-02-2008 , 09:54 AM



Carlos schrieb am 02.04.2008 in
<221a3638-5b82-4086-b097-8e06e50bdccf (AT) x41g2000hsb (DOT) googlegroups.com>:

Quote:
Not sure about what you're trying to do, but a Function Based Unique
Index on (trim(upper(column))) may do the trick...
I try to ensure, that it is impossible to insert/update records in the
way, that after this there are two records, that differ only by
BIG/little - Letters and the number of spaces

example:

CMyColumn
----------
TeSt EnTrY

It should be impossible to insert a record with CMyColumn =
'TEST ENTRY' or 'test entry' or ' test entry ' ...

Quote:
HTH.
I tried it out:
CREATE UNIQUE INDEX MySchema.MyIndexName
ON MySchema.MyTable upper(trim((CLOGINNAME)))
TABLESPACE MyIndexTableSpace LOGGING;
No Problem to create that index, but, after it, still no problem to
insert f.e. 'TEST ENTRY'

Any more idea?

Quote:
Cheers.
Thanks
Carlos.
Andreas

--
wenn email, dann AndreasMosmann <bei> web <punkt> de


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.