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 » WMB : Global Declaration

Post new topic  Reply to topic
 WMB : Global Declaration « View previous topic :: View next topic » 
Author Message
Jithesh shetty
PostPosted: Wed Nov 28, 2007 1:17 am    Post subject: WMB : Global Declaration Reply with quote

Acolyte

Joined: 30 Oct 2007
Posts: 51

I want to declare a global Variable in one of my compute Nodes(store the value in a variable) and then use that global variable in another compute Node and database Node.

is it possible to declare????
Back to top
View user's profile Send private message
Gaya3
PostPosted: Wed Nov 28, 2007 1:22 am    Post subject: Reply with quote

Jedi

Joined: 12 Sep 2006
Posts: 2493
Location: Boston, US

Hi ,

Yes its possible, use Environment variable to do so

Regards
Gayathri
_________________
Regards
Gayathri
-----------------------------------------------
Do Something Before you Die
Back to top
View user's profile Send private message
Jithesh shetty
PostPosted: Wed Nov 28, 2007 1:24 am    Post subject: WMB : Global Declaration Reply with quote

Acolyte

Joined: 30 Oct 2007
Posts: 51

hi,

can u please send me the general syntax for global declarion..?????
Back to top
View user's profile Send private message
Gaya3
PostPosted: Wed Nov 28, 2007 1:36 am    Post subject: Reply with quote

Jedi

Joined: 12 Sep 2006
Posts: 2493
Location: Boston, US

Hi

Are you not going through the Redbooks supplied by IBM, atleast if you would have searched this forum, you should come up with lots of results...

SET Environment.Variable.Name="SEARCH FORUM";

Regards
Gayathri
_________________
Regards
Gayathri
-----------------------------------------------
Do Something Before you Die
Back to top
View user's profile Send private message
Jithesh shetty
PostPosted: Wed Nov 28, 2007 2:08 am    Post subject: WMB : Global Declaration Reply with quote

Acolyte

Joined: 30 Oct 2007
Posts: 51

hi,

i am using databse node for global variable declartion....

CREATE DATABASE MODULE TEST_VMI_Database3
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN

SET Environment.Variable.Date = CURRENT_DATE;
SET Environment.Variable.Time = CURRENT_TIME;

RETURN TRUE;
END;

END MODULE;

in the next DATABASE NODE i am passing this values.....

insert into Database.VMI_AUDIT_LOGS(AUDIT_SEQ_NO, ERROR_SEQ_NO, SERVICE_ID, DOCUMENT_ID, PRCS_START_DT, PRCS_START_TIME, PRCS_END_DT, PRCS_END_TIME, PRCS_STATUS, LOG_MESSAGE, MDN_TIMESTAMP, APERAK_TIMESTAMP, SENDER_ID, RECIEVER_ID) values (i, Val, SERVICEID, DOCUMENTID, Environment.Variable.Date, Environment.Variable.Time, CURRENT_DATE, CURRENT_TIME, 'FAIL', 'Execution of Service : VMI_INVRPT_D97A', '', '', '', '');

while running the message flow....i got below error....

[DataDirect][ODBC Oracle driver]String data, right truncated. Error in parameter 6.

i guess this error because in table i'm using varchar(TIME).........
is it possible to convert SET Environment.Variable.Time = CURRENT_TIME; into string......
Back to top
View user's profile Send private message
shalabh1976
PostPosted: Wed Nov 28, 2007 2:58 am    Post subject: Reply with quote

Partisan

Joined: 18 Jul 2002
Posts: 381
Location: Gurgaon, India

Jithesh,
It seems that you either need proper training or/and need to go through the ESQL guide.
You are missing the CAST statement here.
Also you need to know the format of CURRENT_DATE & CURRENT_TIME.
Please read up.
_________________
Shalabh
IBM Cert. WMB V6.0
IBM Cert. MQ V5.3 App. Prog.
IBM Cert. DB2 9 DB Associate
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Vitor
PostPosted: Wed Nov 28, 2007 3:22 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Gaya3 wrote:
Are you not going through the Redbooks supplied by IBM


shalabh1976 wrote:
It seems that you either need proper training or/and need to go through the ESQL guide....Please read up.


I add to this my comments in one of your previous posts:
http://www.mqseries.net/phpBB2/viewtopic.php?p=197410&highlight=#197410

We're not a training resource, nor are we a live index to the InfoCentre.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Jithesh shetty
PostPosted: Wed Nov 28, 2007 3:30 am    Post subject: WMB : Global Declaration Reply with quote

Acolyte

Joined: 30 Oct 2007
Posts: 51

hi,

if i use Environment.Variable.Date in insert query....its working fine...only the problem i'm getting for TIME.........
Back to top
View user's profile Send private message
shalabh1976
PostPosted: Wed Nov 28, 2007 3:34 am    Post subject: Reply with quote

Partisan

Joined: 18 Jul 2002
Posts: 381
Location: Gurgaon, India

You are not reading:
Quote:
You are missing the CAST statement here.

You may need a substring or format also.
_________________
Shalabh
IBM Cert. WMB V6.0
IBM Cert. MQ V5.3 App. Prog.
IBM Cert. DB2 9 DB Associate
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
jefflowrey
PostPosted: Wed Nov 28, 2007 3:34 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You should have, in this very thread, all the answers you need for how to solve this problem.

You have two choices: Continue to repeat yourself, or attempt to solve the problem.

One of these choices will get you further assistance. One is much less likely to do so.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Nov 28, 2007 3:36 am    Post subject: Re: WMB : Global Declaration Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Jithesh shetty wrote:
if i use Environment.Variable.Date in insert query....its working fine...only the problem i'm getting for TIME.........


We're also not a coding resource. Unless you have a budget and a purchase order.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
francoisvdm
PostPosted: Wed Nov 28, 2007 4:11 am    Post subject: Reply with quote

Partisan

Joined: 09 Aug 2001
Posts: 332

If I'm not mistaken you must match you INPUT data with what the Oracle DB expects. For date and time fields in Oracle make 100% sure you got the format correct for Oracle. First try and hard code some values in there until yo get it to work, then format (cast and/or ESQL coding) your data until it looks 100% like Oracle expects it. for instance, Oracle time field might expect something like "12:22:33, Wednesday", but if you only pass "12:22:33" then Oracle will return an error.
_________________
If you do not know the answer or you get the urge to answer with "RTFM" or "Search better in this forum", please refrain from doing so, just move on to the next question. Much appreciated.

Francois van der Merwe
Back to top
View user's profile Send private message Send e-mail
Jithesh shetty
PostPosted: Thu Nov 29, 2007 11:06 pm    Post subject: WMB : Global Declaration Reply with quote

Acolyte

Joined: 30 Oct 2007
Posts: 51

THANK U ..........

I GOT THE ANSWER....

SET Environment.Variable.Date = CURRENT_DATE;
SET Environment.Variable.Time = CAST(CURRENT_TIME AS character FORMAT 'hh:mm:ss');
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 » WMB : Global Declaration
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.