|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
ESQL CREATE PROCEDURE |
« View previous topic :: View next topic » |
Author |
Message
|
apsy |
Posted: Wed Jul 14, 2004 6:48 am Post subject: ESQL CREATE PROCEDURE |
|
|
 Novice
Joined: 10 Feb 2004 Posts: 24
|
I am trying to create a generic procedure, to which I want to pass in an Input root and Output Root. I want to modify/create an entirely new Output Root and return the new OutputRoot.
Is this possible.???
In the online help for create procedure , there is an example of passing in a Input Root. and returning back a Character variable, which then gets assigned to the Output Root.
Instead of passing back a Character variable, I want to manipulate he Output root inside my procedure and return it back.
How do I accomplish this?
I tried the following procedure declaration
CREATE PROCEDURE CreateResponse ( IN Environment REFERENCE , IN inroot REFERENCE , INOUT outroot REFERENCE)
BEGIN
set outroot.abc = "zzz";
END;
I pass in the following parameters:
CALL CreateResponse( Environment , InputRoot.XML , OutputRoot.XML );
It does not work.
I ran a trace nad it came back with the following error:
2004-07-13 13:51:32.040939 657 RecoverableException BIP2933E: A function or procedure was called but the value supplied for the 'outroot' parameter was not a reference to a reference variable but the definition of the function/procedure requires a reference to a reference variable.
Functions and procedures require references to reference variables to be supplied for OUT and INOUT reference parameters so that the resulting value can be assigned to its target.
Thanks
Apsy  |
|
Back to top |
|
 |
alexey |
Posted: Wed Jul 14, 2004 7:12 am Post subject: |
|
|
 Acolyte
Joined: 18 Dec 2003 Posts: 62 Location: Israel
|
Hi!
Change all parameters to IN, including outroot. It will work OK. Reference can not be changed itself, so it is always IN type. I've tryed to use such a procedure for filling headers - it did fill them, but I had a problem writing the message to a queue after it (no message body found error). So I suggest - do not change the headers in the procedure.
By the way you cannot set char. to "zzz", but do 'zzz'.
Alexey. |
|
Back to top |
|
 |
CoolDude |
Posted: Thu Jul 15, 2004 11:13 am Post subject: |
|
|
Apprentice
Joined: 17 Jan 2004 Posts: 39
|
I am not sure if i got the question correct but.
CREATE FIELD OutputRoot.XML
DELCARE outroot REFERENCE TO OuptutRoot.XML;
DECLARE inroot REFERENCE TO InputRoot.XML;
CALL convert (inroot, outroot);
CREATE PROCEDURE convert (IN inroot REFERENCE, INOUT outroot REFERENCE)
BEGIN
END; _________________ Correct Me from Wrong . If i am correct Appreciate Me  |
|
Back to top |
|
 |
alexey |
Posted: Sat Jul 17, 2004 2:10 pm Post subject: |
|
|
 Acolyte
Joined: 18 Dec 2003 Posts: 62 Location: Israel
|
Hi!
Notice my previous post
alexey wrote: |
Change all parameters to IN, including outroot
|
CoolDude wrote: |
CREATE PROCEDURE convert (IN inroot REFERENCE, INOUT outroot REFERENCE)
BEGIN
END; |
You have to define IN outroot parameter - otherwise you'll have an error described in the question (BIP2933E).
Alexey. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|