ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General Discussion » CopyMessageHeaders Procedure

Post new topic  Reply to topic Goto page 1, 2  Next
 CopyMessageHeaders Procedure « View previous topic :: View next topic » 
Author Message
Sridar
PostPosted: Thu Jun 15, 2006 11:28 pm    Post subject: CopyMessageHeaders Procedure Reply with quote

Acolyte

Joined: 14 May 2006
Posts: 72
Location: Chennai, India

Hi

I have a flow with 4 Compute Node and 3 Filter nodes divided over 3 Label nodes( i mean connected to 3 label nodes).

I am referencing some procedures from a common flow.

Each compute node and Filter node will have the CopyMessageHeaders(created by WBI by default)

I want to know if instead of having this CopyMessageHeaders Procedure in each node can i have it in the commonflow and reference it.

Since the Copy Message Header code is same for all nodes
This would reduce the code length.

Sridar
_________________
Thanks and Regards
Sridar
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Thu Jun 15, 2006 11:35 pm    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi Sridar,

Ofcourse u can...

U can create a new ESQL file...perhaps name it like UTILITY or COMMON etc...paste the common methods there.

If this ESQL file is within the same schema then u can reference it directly from any other ESQL file within the same schema...

If the ESQL file is in another schema, then u will need to add a line in the ESQL where u want to reference it, as
Code:
PATH <name of schema containing the COMMOM>

or
Code:
CALL <Schema name>.CopyMessageHeaders


Regards.
Back to top
View user's profile Send private message Send e-mail
Sridar
PostPosted: Fri Jun 16, 2006 12:59 am    Post subject: Reply with quote

Acolyte

Joined: 14 May 2006
Posts: 72
Location: Chennai, India

Thanks elvis,

Will try and let you know

Sridar
_________________
Thanks and Regards
Sridar
Back to top
View user's profile Send private message
Sridar
PostPosted: Fri Jun 16, 2006 1:49 am    Post subject: Reply with quote

Acolyte

Joined: 14 May 2006
Posts: 72
Location: Chennai, India

Hi

I tried doing that but am not successful.

How will i pass the input message.
Also since i need to return an output i thought of converting it into a function but i am getting Syntax Error when i am trying to call the function from main flow.

Below is the original code created by WBI

CREATE PROCEDURE CopyMessageHeaders() BEGIN
DECLARE I INTEGER 1;
DECLARE J INTEGER CARDINALITY(InputRoot.*[]);
WHILE I < J DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I = I + 1;
END WHILE;
END;

This is how i changed it into a function in the common flow.

CREATE FUNCTION CopyMessageHeaders(InputRoot CHARACTER, OutputRoot CHARACTER) RETURNS CHARACTER
BEGIN
DECLARE I INTEGER 1;
DECLARE J INTEGER CARDINALITY(InputRoot.*[]);
WHILE I < J DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I = I + 1;
END WHILE;
RETURN OutputRoot;
END;

This is how i call it in the main flow

CopyMessageHeaders(InputRoot,OutputRoot);

Can i pass the message to a function by specifying as InputRoot? if not how can i pass it without involving complex logic like converting to BLOB and then converting back.

By the way i forgot to mention my Input message is of XML format.

Sridar
_________________
Thanks and Regards
Sridar
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Fri Jun 16, 2006 2:17 am    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi Sridar,
Sridar wrote:
Also since i need to return an output i thought of converting it into a function but i am getting Syntax Error when i am trying to call the function from main flow.

Use:
Code:
IN InputRoot CHARACTER, INOUT OutputRoot CHARACTER) RETURNS CHARACTER


If you still get an error then add the line schema name before the call.

Regards.
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Fri Jun 16, 2006 2:35 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

InputRoot and OutputRoot are certainly not CHARACTER variables, and you should know that elvis_gn!

Please search here for all of the other times this question has been asked. I'm sure you'll find a good reference in there somewhere.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Fri Jun 16, 2006 3:04 am    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

jefflowrey wrote:
InputRoot and OutputRoot are certainly not CHARACTER variables, and you should know that elvis_gn!

Please search here for all of the other times this question has been asked. I'm sure you'll find a good reference in there somewhere.


Oh God ! I was not at all concentrating on that...sorry...my mistake...I was bothering only about the INOUT..didnt notice that.

Regards.
Back to top
View user's profile Send private message Send e-mail
JT
PostPosted: Fri Jun 16, 2006 11:13 am    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

Jeff wrote:
I'm sure you'll find a good reference in there somewhere.

You forgot to bold it, underline it and blink it.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sat Jun 17, 2006 5:34 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

And don't forget to specify the domain when creating in a generic procedure.
You have to use the CREATE command and add the DOMAIN information (V6) otherwise the parser won't be valid.

Use the search button, there was an exemple posted in the last month or so...

Enjoy...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Sridar
PostPosted: Mon Jun 19, 2006 1:56 am    Post subject: Reply with quote

Acolyte

Joined: 14 May 2006
Posts: 72
Location: Chennai, India

Thanks Guys for all your support.

And sorry for replying late. Was out on a weekend.

Actually i am having only an ESQL file in the commonflow i mentioned.
Cos i just wanted to have all the common procedures seperately.

There is no message flow which means no compute,filter or database nodes to assosiate the code with.

I think i can't pass a message to an Esql file which is not related to any node.

Any case will check for any existing reference.

As of now there is no progress.
_________________
Thanks and Regards
Sridar
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Mon Jun 19, 2006 3:18 am    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi Sridar,
Sridar wrote:
I think i can't pass a message to an Esql file which is not related to any node.

You can create an ESQL file without having a node related to it.

Regards.
Back to top
View user's profile Send private message Send e-mail
Sridar
PostPosted: Mon Jun 19, 2006 3:28 am    Post subject: Reply with quote

Acolyte

Joined: 14 May 2006
Posts: 72
Location: Chennai, India

Elvis,

I have already done that

I was asking whether i can pass a XML Message(InputRoot) to the CopyMessageHeaders Procedure in that ESQL file.

Sridar
_________________
Thanks and Regards
Sridar
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Mon Jun 19, 2006 3:37 am    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi Sridar,
Sridar wrote:
I was asking whether i can pass a XML Message(InputRoot) to the CopyMessageHeaders Procedure in that ESQL file

If you noticed Jeff's post, you would have realised he was refering to REFERENCE.

Use CopyMessageHeaders(IN InputRoot REFERENCE, INOUT OutputRoot REFERENCE)

I hope i'm right, this time around.

Regards.
Back to top
View user's profile Send private message Send e-mail
Sridar
PostPosted: Mon Jun 19, 2006 4:10 am    Post subject: Reply with quote

Acolyte

Joined: 14 May 2006
Posts: 72
Location: Chennai, India

Elvis:

I thought Jeff was mentioning that there could be some Post which i could refer.

All:

I tried the method of using REFERENCE but i am getting error in the debugger referring to this statement CALL CopyMessageHeaders(InputRoot,OutputRoot); and indicates that the problem is with OutputRoot.

Can i just say "CALL CopyMessageHeaders(InputRoot,OutputRoot); " or do i have to any manipulations to pass OutputRoot.

Sridar
_________________
Thanks and Regards
Sridar
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Jun 19, 2006 4:27 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Can you be more explicit about what the debugger says?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » General Discussion » CopyMessageHeaders Procedure
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.