Author |
Message
|
2d0 |
Posted: Thu Mar 08, 2007 7:19 am Post subject: ESQL issue |
|
|
 Apprentice
Joined: 08 Mar 2007 Posts: 25
|
Hi people,
Currently I'm working on a flow with an input and output MRM messageset.
The inputmessage set has to be mapped to the outputmessage set.
Within the inputmessage set, there is a field called order.
This field is 12 characters long.
If this field contains a letter or more letters, I have map it directly and don't have to do anything.
If it doesn't contain a letter, so only numbers, it has to right justified.
How can I look thru this field till I find the letter?
Thanks in advance.
Kind regards,
Todo. |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Mar 08, 2007 7:25 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Model it as characters.
Use SUBSTRING, POSITION, or other String manipulation functions on the value. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
2d0 |
Posted: Thu Mar 08, 2007 7:38 am Post subject: |
|
|
 Apprentice
Joined: 08 Mar 2007 Posts: 25
|
Thanks, but I have to find a position of any letter within the string.
Can I use POSITION([a-z]) ?
Which says all letters from a to z. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Mar 08, 2007 7:50 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
What version? I'm 99% certain 2.1 won't allow a regex expression. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
2d0 |
Posted: Thu Mar 08, 2007 8:03 am Post subject: |
|
|
 Apprentice
Joined: 08 Mar 2007 Posts: 25
|
|
Back to top |
|
 |
Vitor |
Posted: Thu Mar 08, 2007 8:11 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Ok, 75% certain that doesn't either but no direct experience (leapfroged 2.1->6.0).
Some kind person will be along in a moment with a definative answer. Or the ESQL manual may have something to say on the subject of regular expressions.... _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
RocknRambo |
Posted: Thu Mar 08, 2007 10:43 am Post subject: |
|
|
Partisan
Joined: 24 Sep 2003 Posts: 355
|
If I understand correctly, your looking to determine a field is aplha or alphanumeric or numeric ?
I dont think there is direct function or statement in esql which you cud use, as Jeff mentioned you got use position and substring (string manupulation fun's).
you got loop through the field and check whether each char is numeric.
one of the approach cud be - use while and IF,
-RR |
|
Back to top |
|
 |
2d0 |
Posted: Thu Mar 08, 2007 11:12 am Post subject: |
|
|
 Apprentice
Joined: 08 Mar 2007 Posts: 25
|
Yes you are correct Rambo.
But how do I check on numeric?
POSITION(Numeric in ...) ?
Or do i have to enter all the numbers? |
|
Back to top |
|
 |
2d0 |
Posted: Fri Mar 09, 2007 3:23 am Post subject: |
|
|
 Apprentice
Joined: 08 Mar 2007 Posts: 25
|
Well with a little help I have come to the following structure.
Only the IF doesn't work properly.
It doesn't seem to use the OR.
Anyone an idea?
WHILE (i_order_number < i_order_line) DO
DECLARE i_order_pos CHAR SUBSTRING(InputBody.N2_WMS_IF_ADJUST.N2_WMS_AUFNR FROM i_order_number FOR 1);
IF ((i_order_pos <> '0') OR (i_order_pos <> '1') OR (i_order_pos <> '2') OR (i_order_pos <> '3') OR (i_order_pos <> '4') OR (i_order_pos <> '5') OR (i_order_pos <> '6') OR (i_order_pos <> '7') OR (i_order_pos <> '8') OR (i_order_pos <> '9')) THEN
SET OUTREF.ns4:"sap_wmmbid02_e2mbxyi".ns5:"sap_wmmbid02_e2mbxyi".ns5:"Order_number" = InputBody.N2_WMS_IF_ADJUST.N2_WMS_AUFNR;
SET i_order_number = i_order_line;
END IF;
SET i_order_number = i_order_number + 1;
END WHILE; |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Mar 09, 2007 3:50 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
2d0 wrote: |
Yes you are correct Rambo.
But how do I check on numeric?
POSITION(Numeric in ...) ?
Or do i have to enter all the numbers? |
Have you tried creating a java procedure for that purpose?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
2d0 |
Posted: Fri Mar 09, 2007 4:54 am Post subject: |
|
|
 Apprentice
Joined: 08 Mar 2007 Posts: 25
|
People,
Thanks for all the help.
I was able to solve it using several AND statements.
I can post the code if anyone is interested.
Cheers,
Todo. |
|
Back to top |
|
 |
|