467,910 Members | 1,802 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,910 developers. It's quick & easy.

Constraint - check integer string

100+
hi,

i have a field named 'nim', in my table which is a char(10) field.

i want to create a constraint that checks the field so the field must be 10 characters long and each character is a number.

i can only think of nim like '[0-9][0-9][0-9] .... [0-9]' . i can't use isnumeric() because it may still accept dot character right? anyway i've tried to use the isnumeric function but i get this " error Incorrect syntax near ')' ".

i don't know what's wrong with this line
Expand|Select|Wrap|Line Numbers
  1. CONSTRAINT checkNIM CHECK ( len(nim)=10 and isnumeric(nim) )

thank you very much.
Oct 7 '08 #1
  • viewed: 3391
Share:
1 Reply
ck9663
Expert 2GB
IsNumeric() is a function.

Try

Expand|Select|Wrap|Line Numbers
  1. isnumeric(nim) = 1
-- CK
Oct 7 '08 #2

Post your reply

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

Similar topics

3 posts views Thread by Bart V | last post: by
1 post views Thread by Jagdip Singh | last post: by
2 posts views Thread by Robert Fitzpatrick | last post: by
2 posts views Thread by Kenneth Koenraadt | last post: by
25 posts views Thread by Thomas R. Hummel | last post: by
15 posts views Thread by Frank Swarbrick | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.