Author |
Message
|
Kjell |
Posted: Fri Nov 05, 2004 3:17 am Post subject: ESQL POSITION command - syntax error |
|
|
Acolyte
Joined: 26 Feb 2002 Posts: 73
|
Hi
I'm struggling with the POSITION command. Look at this piece of cocde:
DECLARE inRec CHARACTER;
DECLARE rLaengd INTEGER;
SET inRec = CAST(InputRoot.BLOB.BLOB AS CHAR CCSID InputRoot.MQMD.CodedCharSetId);
SET rLaengd = POSITION('~' IN inRec FROM 1);
It complains about the POSITION statement: "Syntax error". I do not understand it. What's wrong?
I read elsewhere in this forum that this syntax error could be ignored. This is not true, since I cannot include the flow in a bar-file as long as there are errors.
Anyone? |
|
Back to top |
|
 |
JT |
Posted: Fri Nov 05, 2004 7:36 am Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
Kjell,
Not sure if this has any impact on the syntax error you're encountering, but try encasing the BLOB keywords (from the previous statement) in quotes, i.e. InputRoot."BLOB"."BLOB". Can't hurt to try.
I've always seen references to the BLOB domain surrounded with quotes (has to do with it being an ESQL keyword). |
|
Back to top |
|
 |
jdlennon |
Posted: Fri Nov 05, 2004 8:41 am Post subject: ESQL POSITION command - syntax error |
|
|
 Novice
Joined: 07 Oct 2004 Posts: 19 Location: The Villages, FL
|
I copied your four lines and pasted into a message flow in my WBI MB and all I get is a warning on the preceding line (the one where your reference the CCSID) saying it can not resolve. But, I was able to ignore and deploy. I am pretty up to date on the CSD and also on the Eclipse fixes. SO, other than maybe suggesting you make sure you are up to date on fixes, sorry I can't help you out. _________________ Jill D Lennon |
|
Back to top |
|
 |
JohnMetcalfe |
Posted: Fri Nov 05, 2004 9:32 am Post subject: |
|
|
 Apprentice
Joined: 02 Apr 2004 Posts: 40 Location: Edinburgh, Scotland
|
What version of WMQI are you on?
My understanding was that the FROM parameter on the POSITION function was add in WBIMB - we are running on WMQI 2.1 CSD4 and your code gives an syntax error in this version (as I'd expect). Removing the FROM clause fixes this. Try SET rLaengd = POSITION('~' IN inRec) ; - does this work? |
|
Back to top |
|
 |
brenner |
Posted: Mon Nov 08, 2004 11:22 pm Post subject: |
|
|
Newbie
Joined: 22 Oct 2004 Posts: 7 Location: IBM Hursley
|
The POSITION function was upgraded in V5. Pre V5 the syntax was
POSITION (search_string IN source_string);
The improved V5 is
POSITION(SearchExpr IN SourceExpr FROM FromExpr REPEAT RepeatExpr);
So, if you are running pre-V5 you should remove the FROM clause. |
|
Back to top |
|
 |
K_A |
Posted: Wed Nov 10, 2004 10:47 pm Post subject: Solved |
|
|
Apprentice
Joined: 10 Nov 2004 Posts: 32
|
I DID use the WBIMB toolkit.
I have now upgraded to CSD4 and the problem is gone. |
|
Back to top |
|
 |
|