Author |
Message
|
Jithesh shetty |
Posted: Wed Nov 28, 2007 1:17 am Post subject: WMB : Global Declaration |
|
|
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 |
|
 |
Gaya3 |
Posted: Wed Nov 28, 2007 1:22 am Post subject: |
|
|
 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 |
|
 |
Jithesh shetty |
Posted: Wed Nov 28, 2007 1:24 am Post subject: WMB : Global Declaration |
|
|
Acolyte
Joined: 30 Oct 2007 Posts: 51
|
hi,
can u please send me the general syntax for global declarion..????? |
|
Back to top |
|
 |
Gaya3 |
Posted: Wed Nov 28, 2007 1:36 am Post subject: |
|
|
 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 |
|
 |
Jithesh shetty |
Posted: Wed Nov 28, 2007 2:08 am Post subject: WMB : Global Declaration |
|
|
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 |
|
 |
shalabh1976 |
Posted: Wed Nov 28, 2007 2:58 am Post subject: |
|
|
 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 |
|
 |
Vitor |
Posted: Wed Nov 28, 2007 3:22 am Post subject: |
|
|
 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 |
|
 |
Jithesh shetty |
Posted: Wed Nov 28, 2007 3:30 am Post subject: WMB : Global Declaration |
|
|
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 |
|
 |
shalabh1976 |
Posted: Wed Nov 28, 2007 3:34 am Post subject: |
|
|
 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 |
|
 |
jefflowrey |
Posted: Wed Nov 28, 2007 3:34 am Post subject: |
|
|
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 |
|
 |
Vitor |
Posted: Wed Nov 28, 2007 3:36 am Post subject: Re: WMB : Global Declaration |
|
|
 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 |
|
 |
francoisvdm |
Posted: Wed Nov 28, 2007 4:11 am Post subject: |
|
|
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 |
|
 |
Jithesh shetty |
Posted: Thu Nov 29, 2007 11:06 pm Post subject: WMB : Global Declaration |
|
|
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 |
|
 |
|