I have a form with a binded Telephone number which was of type number(11), I have now changed this to type char(11) with a constraint as follows:
CHECK(
(SUBSTR(Tel,1,1) BETWEEN '0' AND '9')
AND
(SUBSTR(Tel,2,1) BETWEEN '0' AND '9')
AND
(SUBSTR(Tel,3,1) BETWEEN '0' AND '9')
AND
(SUBSTR(Tel,4,1) BETWEEN '0' AND '9')
AND
(SUBSTR(Tel,5,1) BETWEEN '0' AND '9')
AND
(SUBSTR(Tel,6,1) BETWEEN '0' AND '9')
AND
(SUBSTR(Tel,7,1) BETWEEN '0' AND '9')
AND
(SUBSTR(Tel,8,1) BETWEEN '0' AND '9')
AND
(SUBSTR(Tel,9,1) BETWEEN '0' AND '9')
AND
(SUBSTR(Tel,10,1) BETWEEN '0' AND '9')
AND
(SUBSTR(Tel,11,1) BETWEEN '0' AND '9')
)
I have since changed the datatype of the data set for this column to system.string.
It all works fine in that the form displays the telephone number perfectly fine, but my issue now is that when I update i am getting a constraint error?? I have the textbox limited to 11 in length and basically if I change anything else in the form and try to save these changes it seems to think the telephone number entry is in valid? BUT if I remove the first zero and replace it with anything else like 3 or 4, or something it updates fine.
Any ideas?
Regards
CHECK(
(SUBSTR(Tel,1,1) BETWEEN '0' AND '9')
AND
(SUBSTR(Tel,2,1) BETWEEN '0' AND '9')
AND
(SUBSTR(Tel,3,1) BETWEEN '0' AND '9')
AND
(SUBSTR(Tel,4,1) BETWEEN '0' AND '9')
AND
(SUBSTR(Tel,5,1) BETWEEN '0' AND '9')
AND
(SUBSTR(Tel,6,1) BETWEEN '0' AND '9')
AND
(SUBSTR(Tel,7,1) BETWEEN '0' AND '9')
AND
(SUBSTR(Tel,8,1) BETWEEN '0' AND '9')
AND
(SUBSTR(Tel,9,1) BETWEEN '0' AND '9')
AND
(SUBSTR(Tel,10,1) BETWEEN '0' AND '9')
AND
(SUBSTR(Tel,11,1) BETWEEN '0' AND '9')
)
I have since changed the datatype of the data set for this column to system.string.
It all works fine in that the form displays the telephone number perfectly fine, but my issue now is that when I update i am getting a constraint error?? I have the textbox limited to 11 in length and basically if I change anything else in the form and try to save these changes it seems to think the telephone number entry is in valid? BUT if I remove the first zero and replace it with anything else like 3 or 4, or something it updates fine.
Any ideas?
Regards