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 » Datatype List as parameter in a function

Post new topic  Reply to topic
 Datatype List as parameter in a function « View previous topic :: View next topic » 
Author Message
m.schneider
PostPosted: Mon Jun 11, 2007 3:47 am    Post subject: Datatype List as parameter in a function Reply with quote

Centurion

Joined: 10 Apr 2007
Posts: 132
Location: Germany

Hello,

how can I get the following code to work?

DECLARE rInData REFERENCE TO InputRoot."MRM"."FIN"."TEXT_BLOCK"."MT541";

Set count = getCardinality(rInData.C_Test_Financial_Instrument_Account.SW97A.ACCOUNT_NUMBER[]);

CREATE FUNCTION getCardinality(IN fieldReference CHARACTER)
RETURNS INTEGER
BEGIN
return CARDINALITY(fieldReference);
END;


With this code I get the this error:
BIP2493E: (.receive_MT541_SWIFT2XML.getCardinality, 4.10) : Illegal type for parameter '1' of the function 'CARDINALITY'. A list is required.

I also tried LIST as datatype, but it did not work either.

Thanks for your hel
Back to top
View user's profile Send private message
marcin.kasinski
PostPosted: Mon Jun 11, 2007 4:19 am    Post subject: Re: Datatype List as parameter in a function Reply with quote

Sentinel

Joined: 21 Dec 2004
Posts: 850
Location: Poland / Warsaw

Try to set REFERENCE as a input parameter data type.
_________________
Marcin
Back to top
View user's profile Send private message Visit poster's website
m.schneider
PostPosted: Tue Jun 12, 2007 2:08 am    Post subject: Reply with quote

Centurion

Joined: 10 Apr 2007
Posts: 132
Location: Germany

Thanks for the reply, but REFERENCE also does not work
Back to top
View user's profile Send private message
marcin.kasinski
PostPosted: Tue Jun 12, 2007 2:12 am    Post subject: Reply with quote

Sentinel

Joined: 21 Dec 2004
Posts: 850
Location: Poland / Warsaw

m.schneider wrote:
Thanks for the reply, but REFERENCE also does not work



Without testing ...

Code:
Set count = getCardinality(rInData.C_Test_Financial_Instrument_Account.SW97A.*[]);

_________________
Marcin
Back to top
View user's profile Send private message Visit poster's website
elvis_gn
PostPosted: Tue Jun 12, 2007 2:26 am    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi,

Code:
Set count = getCardinality(rInData.C_Test_Financial_Instrument_Account.SW97A.ACCOUNT_NUMBER[]);

Code:
Set count = getCardinality(rInData.C_Test_Financial_Instrument_Account.SW97A.*[]);
The only difference in the above two lines would be that the first should have found the count of fields named 'ACCOUNT_NUMBER', whereas the second would fetch all fields under SW97A, irrespective of name.

I think the problem is while sending the reference to the function(you are sending a list as reference)....either use cardinality directly where you use getCardinality, OR
Code:
Set count = getCardinality(rInData.C_Test_Financial_Instrument_Account.SW97A.ACCOUNT_NUMBER[1]);

CREATE FUNCTION getCardinality(IN fieldReference REFERENCE)
RETURNS INTEGER
BEGIN
return CARDINALITY(fieldReference);
END;
P.S: Code not tested.

Regards.
Back to top
View user's profile Send private message Send e-mail
m.schneider
PostPosted: Wed Jun 13, 2007 6:10 am    Post subject: Reply with quote

Centurion

Joined: 10 Apr 2007
Posts: 132
Location: Germany

Thanks for your replies, I will use CARDINALITY direct, ...
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 » Datatype List as parameter in a function
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.