Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Database > Oracle
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Oracle General Oracle database discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Oracle section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 13th, 2004, 07:27 AM
Registered User
Join Date: Apr 2004
Location: Wolverhampton, , United Kingdom.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Constraint for names

Is is possible to create a constraint which checks that all characters in a string (e.g. a person's name) are letters or certain allowed characters such as an apostrophe or hyphen?

John D'Arcy-Smith is allowed
Peter Sm1!th is not allowed.


  #2 (permalink)  
Old April 13th, 2004, 07:37 AM
aas aas is offline
Authorized User
Join Date: Mar 2004
Location: Moscow, , Russia.
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to aas

why do you want create it is as constraint?
You can create trigger on your table (before insert or update) and check :new.name.

  #3 (permalink)  
Old April 14th, 2004, 01:29 PM
Registered User
Join Date: Apr 2004
Location: Wolverhampton, , United Kingdom.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

I have a type (UDT) for names, which is used in several tables. I would like the constraint to apply to the type so that I don't have to add a trigger for every table. Every time a table is created which uses the name type, the constraint will automatically apply.


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I have a constraint like this.....? callagga SQL Language 7 August 13th, 2008 01:08 AM
Constraint Vs Index carumuga SQL Server 2000 2 December 4th, 2007 02:14 AM
Identity Constraint in DataSet anujrathi Pro VB.NET 2002/2003 1 June 21st, 2006 04:50 AM
CHECK Constraint Error Kep SQL Server 2000 5 April 11th, 2006 08:46 PM
constraint for 1-to-n relation j_yan MySQL 0 December 10th, 2004 11:03 PM

All times are GMT -4. The time now is 09:05 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.