Hi;
I was going through code some else developed and it was checking for a constraint Phone_Number MATCHES '3N1X3N1X4N' ; What does this mean;
I have an incoming phone number is having an value 9208455403; but this was rejected as for this constraint , could some one tell me how the incoming number should be to pass this constraint.
as we all know 10 digits phone number is valid in USA and 9208455403 is an ten digit number how the form of this should be to pass the above constraint
920-845-5403
920X845X5403 or any other format what exacrly 3N1X3N1X4N' mean
Phone_Number MATCHES '3N1X3N1X4N'
Moderators: chulett, rschirm, roy
Phone_Number MATCHES '3N1X3N1X4N'
RRCHINTALA
3N1X3N1X4N means
three Number-one character-three Number-one character-four Number.
Remember, that this is only true for Canada+USA. Internationaly there is a ISO-Standard for phone-numbers, which makes a phonenumberb look like +<country Code>-<local Code>-phone-number-extention.
+1-902-8455403 for the number you mention
country codes are between one (7 for Russia, 1 for North America) and three digit (342 for Slovakia)
local codes are between one (France) and up to 5 digits (Germany)
telefone-numbers are between 3 (Germany) and up to 15 digits (Germany) even in same local zones.
So ISO is best for telefone and telefax.
Wolfgang
three Number-one character-three Number-one character-four Number.
Remember, that this is only true for Canada+USA. Internationaly there is a ISO-Standard for phone-numbers, which makes a phonenumberb look like +<country Code>-<local Code>-phone-number-extention.
+1-902-8455403 for the number you mention
country codes are between one (7 for Russia, 1 for North America) and three digit (342 for Slovakia)
local codes are between one (France) and up to 5 digits (Germany)
telefone-numbers are between 3 (Germany) and up to 15 digits (Germany) even in same local zones.
So ISO is best for telefone and telefax.
Wolfgang
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
A ten digit number will never match that pattern, because that pattern matches a string containing three digits, one "any" character, three more digits, one more "any" character then four more digits. If your source data are purely numeric, you may prefer as your test.
If you want to be able to match either, you can have a multi-valued match pattern; the @VM signifies "or" in some sense. For example
You can be explicit about the characters in the match pattern by turning them into literal (quoted) strings. For example
For another example, a pattern to match the ISO standard would beThe zero in these pattern elements means "any number of" so that this pattern recognizes strings made up of a "+" character, at least one numeric character, a "-" character, at least one numeric character, a "-" and at least one numeric character. That is, "1N0N" means "at least one numeric character" because it means "one numeric character followed by any number of numeric characters (including none)".
Code: Select all
InLink.Phone_Number MATCHES "10N"
If you want to be able to match either, you can have a multi-valued match pattern; the @VM signifies "or" in some sense. For example
Code: Select all
InLink.Phone_Number MATCHES "10N" : @VM : "3N1X3N1X4N"
Code: Select all
InLink.Phone_Number MATCHES "3N'-'3N'-'4N"
For another example, a pattern to match the ISO standard would be
Code: Select all
"'+'1N0N'-'1N0N'-'1N0N"
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.