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 » message through out1 terminal using ROUTING:BEGIN ATOMIC

Post new topic  Reply to topic Goto page Previous  1, 2, 3  Next
 message through out1 terminal using ROUTING:BEGIN ATOMIC « View previous topic :: View next topic » 
Author Message
smdavies99
PostPosted: Wed Jan 28, 2009 11:04 pm    Post subject: Reply with quote

Jedi Council

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

One solution is to modify your original select statement so that there is only 1 row returned
Then the fixed index of [1] will always apply.
_________________
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
rekarm01
PostPosted: Thu Jan 29, 2009 1:45 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 1415

rohank84 wrote:
I tried to do this

SET terminalnumber = (Select emp.email as TERMNO from CacheQueueTable.DestinationData[] as emp WHERE emp.hostname = chardata);

SET portnumber = (Select emp.name as portno from CacheQueueTable.DestinationData[] as emp WHERE emp.hostname = chardata);

but its gives me an error
BIP2497E: (.MF_TCP_SEND_Compute.Main, 26. : Illegal data type for target. A list field reference is required.

The SELECT function normally returns a list, but 'terminalnumber' is a scalar variable. You might find the THE function and SelectClause ITEM keyword useful:
Code:
SET terminalnumber = THE(SELECT ITEM ... );

You can read more about them in your toolkit help.
You might also find it useful to add a trace node to see what's actually in your cache table.
Back to top
View user's profile Send private message
rohank84
PostPosted: Thu Jan 29, 2009 3:23 am    Post subject: Reply with quote

Centurion

Joined: 31 Dec 2008
Posts: 109

hi tried adding THE function ..the error is gone ...but the value is not retrieved ....

javascript:emoticon('')

any other option left....
Back to top
View user's profile Send private message
rohank84
PostPosted: Thu Jan 29, 2009 3:28 am    Post subject: Reply with quote

Centurion

Joined: 31 Dec 2008
Posts: 109

davies im not able to understand wht you are saying ...my query will always return a single row so THE function is correct.....i tried using it ...the error is gone but value is not retrieved from the query .....''
Back to top
View user's profile Send private message
smdavies99
PostPosted: Thu Jan 29, 2009 3:40 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.

If you query only returns 1 row then you can use the indes of [1] are previously shown to retrieve the data.
I do this all the time.

A little tip here.
Set the destination of your query results to be in the Environment tree.
Then place a trace node downstream of the Compute node and output the

${Environment}

This way you can see what was returned and how the field names are labelled....
You may be surprised at what you see.

I'd disconnect the trace node from the output node until you are certain that you have all the folders properly setup.
_________________
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
rohank84
PostPosted: Thu Jan 29, 2009 4:03 am    Post subject: Reply with quote

Centurion

Joined: 31 Dec 2008
Posts: 109

hi davies

the original query will return multiple rows but the cache query will return a single row ....

And I am not clear about what is environment tree...u mean to say putting the result in the Environment variable ...if yes then i have tried that but the value is still not retrieved ....

your idea is good to get only 1 row from the original query but in my case it will return multiple rows and then i have to query the cache table and get the particular data which will be a single row......

thanks a ton for ur efforts...please help if u can
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Jan 29, 2009 4:14 am    Post subject: Reply with quote

Grand High Poobah

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

I think smdavies was quite clear:
store the result of the select in the Environment.
This way you can see what the values were at runtime by using the trace node and verify that they are what you are expecting....

Once you "see" what you are getting you might realize that it is different from what you are expecting...

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
rohank84
PostPosted: Thu Jan 29, 2009 4:25 am    Post subject: Reply with quote

Centurion

Joined: 31 Dec 2008
Posts: 109

hi

instead of trace node ..im using log4j and the value retrieved is empty.....

i am sure that the value is there in the shared variable ...even tried getting value directly from shared variable (without firing the query in cache table) and the value is retrieved ....So the value is present there...

I tried putting the result in environement variable but the retrived value is same i.e empty ....
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Jan 29, 2009 4:30 am    Post subject: Reply with quote

Grand High Poobah

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

rohank84 wrote:
hi

instead of trace node ..im using log4j and the value retrieved is empty.....

I tried putting the result in environement variable but the retrived value is same i.e empty ....

Trace node and log4j .... not the same.

If you have a namespace problem log4j will not help you. If you have a typo problem with the field name, log4j will not help you. The trace node by dumping the $Environment variable that holds your select result will show you what you have.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
rohank84
PostPosted: Thu Jan 29, 2009 6:03 am    Post subject: Reply with quote

Centurion

Joined: 31 Dec 2008
Posts: 109

( ['MQROOT' : 0x7317da8]
(0x01000000:Name):Variables = (
(0x01000000:Name):TCPSEND =
)
)

this is the output that i get in the trace node ...

the TCPSEND is the environment variable where i put the result

below is the esql ...might help you to understand...

ROUTING : BEGIN ATOMIC -- beginning of atomic block. Processing is single threaded until the END; is reached
IF CacheQueueTable.valid IS NULL THEN
SET CacheQueueTable.DestinationData[] = (Select emp.email as TERMNO,emp.name as portno from Database.EMP_DETAILS as emp WHERE emp.hostname = chardata);

SET CacheQueueTable.valid = true;
END IF;

SET Environment.Variables.TCPSEND.TCP[] = (Select emp.email as TERMNO,emp.name as portno from CacheQueueTable.DestinationData[] as emp WHERE emp.hostname = chardata);

set terminalnumber = Environment.Variables.TCPSEND.TCP[1].TERMNO;
set portnumber = Environment.Variables.TCPSEND.TCP[1].portno;

END ROUTING ; -- end of the ROUTING atomic block
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Jan 29, 2009 6:09 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Code:
SET  Environment.Variables.CacheTable =CacheQueueTable
Back to top
View user's profile Send private message
rohank84
PostPosted: Thu Jan 29, 2009 6:13 am    Post subject: Reply with quote

Centurion

Joined: 31 Dec 2008
Posts: 109

hi jeff

but where shud i put this ....n how it helps
Back to top
View user's profile Send private message
smdavies99
PostPosted: Thu Jan 29, 2009 1:49 pm    Post subject: Reply with quote

Jedi Council

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

Change your original select to put the results in the Environment tree

set Environment.Select.Result[] = Select ....;

Then add a trace node after the compute node.

Configure it to output the environment tree

${Environment}

Then take a user trace or set the node to output for a file.
You can then poast the relevant section here.
I'm sure you will be surprised by the results.
_________________
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
rohank84
PostPosted: Thu Jan 29, 2009 10:57 pm    Post subject: Reply with quote

Centurion

Joined: 31 Dec 2008
Posts: 109

hi davies

This is wht i get when i put the original query in Environemnt tree...i get the values that i store ...here's the output of trace node

( ['MQROOT' : 0x7315900]
(0x01000000:Name):Select = (
(0x01000000:Name):Result = (
(0x03000000:NameValue):TERMNO = '14147' (CHARACTER)
(0x03000000:NameValue):portno = 'localhost' (CHARACTER)
)
)
(0x01000000:Name):Variables = (
(0x01000000:Name):Log4j = (
(0x03000000:NameValue):LogText = 'in else' (CHARACTER)
)
)
)


the logText that u see here is Log4j that i have used in out terminal of compute node ....I tried Cardinality in esql ..here's the code

if CARDINALITY(Environment.Select.*[])=0 then
set Environment.Variables.Log4j.LogText = 'in if';

else
set Environment.Variables.Log4j.LogText = 'in else';

end if;


I do the same thing of putting the cache table query in environment tree and results are totally opposite
Trace node gives

( ['MQROOT' : 0x98f190]
(0x01000000:Name):Select =
)
( ['MQROOT' : 0x73161a0]
(0x01000000:Name):Select =
(0x01000000:Name):Variables = (
(0x01000000:Name):Log4j = (
(0x03000000:NameValue):LogText = 'in if' (CHARACTER)
)
)
)

and the cardinality code is same as above ....so i guess the query results is not setting into the environment variable...
Back to top
View user's profile Send private message
smdavies99
PostPosted: Thu Jan 29, 2009 11:43 pm    Post subject: Reply with quote

Jedi Council

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

so your query returns 1 row of 2 columns.

Then you can use the index of [1] to retrieve the data as previously shown.
_________________
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
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2, 3  Next Page 2 of 3

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » message through out1 terminal using ROUTING:BEGIN ATOMIC
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.