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 » Access Global Environment Variables within a create function

Post new topic  Reply to topic
 Access Global Environment Variables within a create function « View previous topic :: View next topic » 
Author Message
kamy
PostPosted: Wed Apr 16, 2003 1:34 pm    Post subject: Access Global Environment Variables within a create function Reply with quote

Novice

Joined: 26 Oct 2001
Posts: 21

Hi All,
We are creating a function using 'CREATE FUNCTION'. Within the function, we would like to access our previously defined environment variable, which is structured as:

<Environment>
<Field>Data</Field>
<Field>Data</Field>
<Field>Data</Field>
</Environment>.

Is there a way to pass this environment variable to the created function?

The function looks something like:
CREATE FUNCTION CHeckIsNull (FieldName CHAR, TotalCount INT) RETURNS Char
BEGIN
DECLARE NullIndex INT;
DECLARE IsNull CHAR;
SET NullIndex = 1;
SET IsNull = 'N';
WHILE IsNull = 'N' AND NullIndex <= TotalCount DO
IF Environment.Field[NullIndex] = FieldName THEN
SET IsNull = 'Y';
END IF;
SET NullIndex = NullIndex + 1;

END WHILE;
RETURN IsNull;
END;

This code is not deployable, indicating that 'Environment' is not a valid correlation name, but we have not been able to devise a way to pass the global environment variable to the function.

Any help would be greatly appreciated.

Thank you very much.
K
Back to top
View user's profile Send private message Send e-mail
warrenpage
PostPosted: Wed Apr 16, 2003 4:18 pm    Post subject: Pass the Environment as a reference Reply with quote

Acolyte

Joined: 19 Feb 2002
Posts: 56
Location: Australia

Use something like


CALL Audit(Environment, 'Audit Msg');


CREATE PROCEDURE Audit (IN Environment REFERENCE, IN remarks CHAR)
BEGIN
DECLARE auditRoot REFERENCE to Environment.Audit;

SET auditRoot.remarks = remarks;

END;
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
kamy
PostPosted: Thu Apr 17, 2003 5:56 am    Post subject: Reply with quote

Novice

Joined: 26 Oct 2001
Posts: 21

It Works, Thank You Very much.

- k
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Access Global Environment Variables within a create 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.