Author |
Message
|
dandydon |
Posted: Wed Jun 11, 2003 9:58 am Post subject: Syntax error using CREATE FUNCTION |
|
|
Newbie
Joined: 08 May 2003 Posts: 6 Location: Fort Worth, Texas
|
I am trying to use the CREATE FUNCTION utility in a Compute Node and am getting a syntax error. I am using WMQI Version 2.1 (CSD04). I tried using the sample code in the ESQL Reference for 2.1 (shown below), but still get the error.
CREATE FUNCTION MultiplyByTwo(Value INTEGER) RETURNS INTEGER
RETURN Value * 2;
The syntax error cursor is just before the first parenthesis (. The Help window at the left of the Compute Node does not show a CREATE FUNCTION utility available. Various sites on the internet indicate that the CREATE FUNCTION will work on CSD02 and above and that the CSD’s are cumulative. Does anyone know if this is true? Do I have to load CSD02 and CSD03 before loading CSD04? I have plowed through the IBM documentation, but can find no help on this.
Last edited by dandydon on Wed Jun 11, 2003 10:30 am; edited 1 time in total |
|
Back to top |
|
 |
drajib |
Posted: Wed Jun 11, 2003 10:13 am Post subject: |
|
|
 Apprentice
Joined: 25 Mar 2003 Posts: 42 Location: India
|
Remove the ')' from after 'RETURNS INTEGER'
Code: |
create function f (v INTEGER) returns INTEGER
return v*2;
|
|
|
Back to top |
|
 |
dandydon |
Posted: Wed Jun 11, 2003 10:25 am Post subject: |
|
|
Newbie
Joined: 08 May 2003 Posts: 6 Location: Fort Worth, Texas
|
Oops! The extra ) was a typo in my Bulletin Board posting. I just corrected it. I had entered the code correctly into the Compute Node, trying many different forms, but getting a syntax error no matter what I entered. |
|
Back to top |
|
 |
shalabh1976 |
Posted: Wed Jun 11, 2003 12:16 pm Post subject: |
|
|
 Partisan
Joined: 18 Jul 2002 Posts: 381 Location: Gurgaon, India
|
Try this :
CREATE FUNCTION MultiplyByTwo(Value INTEGER) RETURNS INTEGER
BEGIN
RETURN Value * 2;
END; |
|
Back to top |
|
 |
dandydon |
Posted: Wed Jun 11, 2003 1:59 pm Post subject: |
|
|
Newbie
Joined: 08 May 2003 Posts: 6 Location: Fort Worth, Texas
|
I had already tried the BEGIN/END syntax. I just retried it, but still got the syntax error. Thanks for the suggestion. I think maybe I will just have to install CSD02 or CSD03, then maybe CSD04 again. |
|
Back to top |
|
 |
shalabh1976 |
Posted: Wed Jun 11, 2003 2:45 pm Post subject: |
|
|
 Partisan
Joined: 18 Jul 2002 Posts: 381 Location: Gurgaon, India
|
I am on CSD 2 and when I tried it out, it didn't show the syntax error.
Testing on CSD 3 has also worked.
I have not tested on CSD 4.
All the best.
There might also be a syntax error somewhere else in the code.
The error checker is not infalliable.
I have seen it make mistakes.
Use the check message flow option.
It has helped me out a couple of times by pointing out the exact error. |
|
Back to top |
|
 |
kirani |
Posted: Wed Jun 11, 2003 10:06 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Yes, CREATE FUNCTION statement is available in CSD2 and above. You can directly install CSD4 on your machine without installing CSD2 and CSD3.
Hope this helps. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
Ian |
Posted: Fri Jun 13, 2003 2:33 am Post subject: |
|
|
Disciple
Joined: 22 Nov 2002 Posts: 152 Location: London, UK
|
Hi,
Checked this on my WMQIv2.1 CSD04 setup and the ESQL syntax checker does not highlight an error for either of the following :
Code: |
CREATE FUNCTION MultiplyByTwo(Value INTEGER) RETURNS INTEGER
RETURN Value * 2;
|
Code: |
CREATE FUNCTION MultiplyByTwo(Value INTEGER) RETURNS INTEGER
BEGIN
RETURN Value * 2;
END;
|
Suggest you post all the ESQL for this particular node as it is probably some other syntax that is the cause of this (and the ESQL syntax checker is possibly incorrectly highlighting this syntax). _________________ Regards, Ian |
|
Back to top |
|
 |
shalabh1976 |
Posted: Fri Jun 13, 2003 6:55 am Post subject: |
|
|
 Partisan
Joined: 18 Jul 2002 Posts: 381 Location: Gurgaon, India
|
Have you tried using the check message flow option. |
|
Back to top |
|
 |
dandydon |
Posted: Mon Jun 16, 2003 8:55 am Post subject: |
|
|
Newbie
Joined: 08 May 2003 Posts: 6 Location: Fort Worth, Texas
|
On a hunch I tried deploying the flow, and it deployed without error, then ran without error. Weird! I suspected that the syntax checker had been speaking with a forked tongue, so I contacted IBM Support and had a support person look at the flow on his machine. He also got a syntax error, but on the BITSTREAM utility I was using, not on the CREATE FUNCTION utility. He was using the same versions of MQSeries and MQSI that I was using. He also said the BITSTREAM utility was no longer supported on CSD4. I don't know why his error was in a different place in the flow than mine was, but since I can deploy and run the flow, I am happy - a little perplexed maybe, but happy. |
|
Back to top |
|
 |
Ian |
Posted: Tue Jun 17, 2003 2:08 am Post subject: |
|
|
Disciple
Joined: 22 Nov 2002 Posts: 152 Location: London, UK
|
Hi,
Quote: |
He also said the BITSTREAM utility was no longer supported on CSD4.
|
This is incorrect.
The BITSTREAM function has not been deprecated and is still supported at all levels, including WMQIv2.1 CSD04.
A new function, ASBITSTREAM, was introduced in level WMQIv2.1 CSD03 and may be the preference as it offers extended functionality over the BITSTREAM function but it has not replaced it. _________________ Regards, Ian |
|
Back to top |
|
 |
Ian |
Posted: Tue Jun 17, 2003 2:49 am Post subject: |
|
|
Disciple
Joined: 22 Nov 2002 Posts: 152 Location: London, UK
|
Hi,
Just another thought ...
Quote: |
I tried deploying the flow, and it deployed without error, then ran without error.
|
I can think of two reasons why this could occur :
1. The Control Center ESQL syntax checker and the Broker "ESQL checker" (in other words applying deployed config messages to the broker runtime) are two seperate components and therefore there is a possibility that there could be inconsistancies between the two ...
2. Your Control Center and Broker could be at different CSD levels and therefore what could be an error in one component is not an error in the other ... to turn this around, your CC could be at CSD04 and accept the CREATE FUNCTION syntax and broker could be at CSD02 and not accept the deployed messageflow. _________________ Regards, Ian |
|
Back to top |
|
 |
dandydon |
Posted: Tue Jun 17, 2003 10:42 am Post subject: |
|
|
Newbie
Joined: 08 May 2003 Posts: 6 Location: Fort Worth, Texas
|
I checked CSD levels on both the Control Center and the Broker on the Server, and both were CSD04 (Registry actually shows CSD05, which really means CSD04 according to another message on this Bulletin Board). However, the Control Center on my Client workstation showed no CSD installed. We were not aware that the CSD needed to be on the Client workstations. However, since Ian pointed out that it needed to be installed on both the Broker and the Control Center, and my workstation had its own separate Control Center, I installed CSD04 on my workstation. Now I get the syntax error on the BITSTREAM utility, but not on the CREATE FUNCTION utility, the same as the person I talked with at IBM. My Integrator may still be "broke", but at least it's "broke right" according to IBM. Also the BITSTREAM utility is described on page 96 of the new ESQL Manual for Integrator 2.1, so I assume it must be fully supported, though it now gives a syntax error after installing CSD04. Thanks, Ian. |
|
Back to top |
|
 |
|