Author |
Message
|
SOLOHERO |
Posted: Tue Apr 03, 2007 9:19 pm Post subject: ESQL |
|
|
Centurion
Joined: 01 Feb 2007 Posts: 107
|
how can i restrict a string length in esql.
eg. I want the input message comming should be of length on 4 chars if it is more than 4 i should throw an error. _________________ Thanks |
|
Back to top |
|
 |
sarat |
Posted: Tue Apr 03, 2007 9:56 pm Post subject: |
|
|
 Centurion
Joined: 29 Jun 2005 Posts: 136 Location: India
|
Yo u want to check the particular filed or entire message length?
Take a look at LENGTH function!!!! _________________ With Regards,
Sarat. |
|
Back to top |
|
 |
Mensch |
Posted: Tue Apr 03, 2007 11:56 pm Post subject: |
|
|
Disciple
Joined: 17 Jul 2005 Posts: 166
|
Use LENGTH function or create message set  _________________ Thanks and Regards ,
Mensch |
|
Back to top |
|
 |
SOLOHERO |
Posted: Thu Apr 05, 2007 4:42 pm Post subject: |
|
|
Centurion
Joined: 01 Feb 2007 Posts: 107
|
tHANKS BUT
HOW DO I IMPLEMENT IT SAY
x=3124;
Length('x')
How can i restrict to 4 not greater /less than 4.
Thanks _________________ Thanks |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Apr 05, 2007 5:20 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
SOLOHERO wrote: |
tHANKS BUT
HOW DO I IMPLEMENT IT SAY
x=3124;
Length('x')
How can i restrict to 4 not greater /less than 4.
Thanks |
In the MRM parser / message set:
First you need to set it up as String and not number or integer because it would strip leading zeros off numbers in xml serialization.
Second give it a facet of \d{4} and you should be done.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Apr 05, 2007 5:56 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
SUBSTRING. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
kimbert |
Posted: Fri Apr 06, 2007 3:29 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
'\d{4}' is pattern ( regular expression ). You don't need a Pattern constraint for this. Surprisingly, a Length constraint will do the job very nicely  |
|
Back to top |
|
 |
sarat |
Posted: Sun Apr 08, 2007 10:13 pm Post subject: |
|
|
 Centurion
Joined: 29 Jun 2005 Posts: 136 Location: India
|
Quote: |
tHANKS BUT
HOW DO I IMPLEMENT IT SAY
x=3124;
Length('x')
How can i restrict to 4 not greater /less than 4. |
If ur not going to sets...
U can check....
IF LENGTH(x) = 4 THEN
u can use like this!!! _________________ With Regards,
Sarat. |
|
Back to top |
|
 |
|