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 » WebSphere Message Broker (ACE) Support » how to pass a list to procedure

Post new topic  Reply to topic
 how to pass a list to procedure « View previous topic :: View next topic » 
Author Message
saikrishna
PostPosted: Wed Jul 29, 2015 5:43 am    Post subject: how to pass a list to procedure Reply with quote

Novice

Joined: 29 Jul 2015
Posts: 21

Wanna pass list to procedure:
CALL Message(LIST{'a','b','c','d'});

Note: aoart from assigning list to array is there any other option?
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Jul 29, 2015 5:52 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

IIB does not have arrays.

The sooner you believe that, the easier things will be.

It has logical message trees, and lists. Lists are only useful in very certain conditions.

What you see with [] are either elements in a logical message tree, or elements in a ROW. You should almost never access these by index.
Back to top
View user's profile Send private message
saikrishna
PostPosted: Wed Jul 29, 2015 6:16 am    Post subject: Reply with quote

Novice

Joined: 29 Jul 2015
Posts: 21

Am using WMB8
I can achieve this by using below statements
SET Environment.Variables.Mandatory.*[] = LIST{'a','b','c','d'};
DECLARE MANDATORY REFERENCE TO Environment.Variables.Mandatory;
Call Message(MANDATORY);

But my doubt is like is there any option to send LIST as a parameter?
Back to top
View user's profile Send private message
saikrishna
PostPosted: Wed Jul 29, 2015 6:18 am    Post subject: Reply with quote

Novice

Joined: 29 Jul 2015
Posts: 21

My requirement is like

Need to pass 'n' LIST's to a procedure(instead of assigning n LISTS to environment[])
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Jul 29, 2015 6:21 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

saikrishna wrote:
My requirement is like

Need to pass 'n' LIST's to a procedure(instead of assigning n LISTS to environment[])


Your requirement is to understand the difference between a LIST and a ROW.

And stop thinking about lists.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Jul 29, 2015 6:39 am    Post subject: Reply with quote

Grand High Poobah

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

IIRC a procedure will take a reference as an argument but will not accept a list or a row.
As I said from memory. Look up the Knowledge Center for the proper reference.
_________________
MQ & Broker admin


Last edited by fjb_saper on Thu Jul 30, 2015 4:47 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
saikrishna
PostPosted: Thu Jul 30, 2015 2:19 am    Post subject: Reply with quote

Novice

Joined: 29 Jul 2015
Posts: 21

As per ur suggestions passing ROW instead of LIST

CREATE PROCEDURE CopyEntireMessage() BEGIN
DECLARE x ROW;
set x=ROW('a','b');
CALL CallMessage(x);
END;
CREATE PROCEDURE CallMessage (IN x ROW)
BEGIN

No errors, but while depploying into EG am getting below error:

Syntax error : 'keyword Row'.
The token caused a syntax error.
Correct the syntax of your ESQL expression in node '.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Jul 30, 2015 4:49 am    Post subject: Reply with quote

Grand High Poobah

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

Which part of "you cannot use a list or a row as argument to a procedure" did you not understand?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
saikrishna
PostPosted: Thu Jul 30, 2015 4:55 am    Post subject: Reply with quote

Novice

Joined: 29 Jul 2015
Posts: 21

Thanks
List I agree, but y not for ROW...
Any reason behind that..
then why it is suggesting ROW as parameter type when creating procedure..
Back to top
View user's profile Send private message
smdavies99
PostPosted: Thu Jul 30, 2015 4:57 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

saikrishna wrote:
Thanks
List I agree, but y not for ROW...
Any reason behind that..
then why it is suggesting ROW as parameter type when creating procedure..


If autocomplete is doing that then it could be a bug. Raise a PMR with IBM.
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
saikrishna
PostPosted: Thu Jul 30, 2015 5:05 am    Post subject: Reply with quote

Novice

Joined: 29 Jul 2015
Posts: 21

Thanku all
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » how to pass a list to 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.