By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,118 Members | 1,134 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,118 IT Pros & Developers. It's quick & easy.

More Constraints

P: 8
Hi!

To you all again. With your help I've succeeded in placing an advanced constraint for entering data in the acct_dept_table (see advanced constraint). I would like to add more constraint in field entries in the dept_table

I want to make sure that all the 5 characters in the dept table must be entered and that those 5 characters have to be numerical characters (no letters or blank spaces or other characters)

Thanks Again

Kooter12000
Feb 6 '08 #1
Share this Question
Share on Google+
2 Replies


Expert 100+
P: 700
Hi!

To you all again. With your help I've succeeded in placing an advanced constraint for entering data in the acct_dept_table (see advanced constraint). I would like to add more constraint in field entries in the dept_table

I want to make sure that all the 5 characters in the dept table must be entered and that those 5 characters have to be numerical characters (no letters or blank spaces or other characters)

Thanks Again

Kooter12000
Use check constraint and regular expression, I do not remember your table but for example you can define a table like that
create table tab (col varchar(5) check (col ~ '[0-9][0-9][0-9][0-9][0-9]'));
if you want column col meets your demands.
Feb 6 '08 #2

P: 8
That was fast. yes it works. Thanks rski. Almost had it placed commas in between the square brackets and parenthesis before ~ and after '

kooter12000
Feb 6 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.