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 » Help Using PASSTHRU with SELECT + THE

Post new topic  Reply to topic
 Help Using PASSTHRU with SELECT + THE « View previous topic :: View next topic » 
Author Message
GoodBoy
PostPosted: Thu Apr 08, 2004 4:12 pm    Post subject: Help Using PASSTHRU with SELECT + THE Reply with quote

Novice

Joined: 19 Jan 2004
Posts: 10

Hi All,

Can anyone help me with using PASSTHRU to my situation.

My original query to a database under schema abcd45 is :

select DISTINCT MAX(Pid) from abcd45.table5;
Returns : 3

This works fine at SQL prompt.

I was implementing it in Database node as follows:

DECLARE schema1 CHAR;
DECLARE temp INT;
SET schema1 = 'abcd45';

SET temp = PASSTHRU ('SELECT DISTINCT MAX(E1.Pid) FROM ' || schema1 ||'.table5 E1');

SET Environment.variable.temp555 = temp;

------------------------------

And I am trying to see the value of temp555 in the trace file. By setting
Pattern to : ${Environment.variable.temp555}
---------------------------------------------------------

The Query is working and it is ubable to assign the result (in this example 3 an integer value) to temp. saying
'Trying to assign or use a list as a scalar'
-----------------------------------------------------

How can I accommodate 'THE' in the PASSTHRU to change resulting 'list' from select statement to a 'scalar' value . In my case the result is list of single value 3.

Pl halp me in fixing this.

GoodBoy
Back to top
View user's profile Send private message
martinrydman
PostPosted: Thu Apr 08, 2004 11:26 pm    Post subject: Reply with quote

Centurion

Joined: 30 Jan 2004
Posts: 139
Location: Gothenburg, Sweden

Hi!

To the best of my knowledge, you can't. PASSTRHRU will *always* expect the receiving variable to be a list. So, in your case:

Code:

SET Environment.variable.temp[] = PASSTHRU ('SELECT DISTINCT MAX(E1.Pid) FROM ' || schema1 ||'.table5 E1');

SET Environment.variable.temp555 = Environment.variable.temp[1].*[1];


should do the trick. Note that temp[1] will get a child element. I'm not sure what name it will get in this case, but I'd guess something like Column0. Since you're not interested in that name, the syntax temp[1].*[1] will return the first child of temp[1], regardless of its name.

HTH

/Martin
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 » Help Using PASSTHRU with SELECT + THE
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.