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 » retrieve data from two different tables

Post new topic  Reply to topic
 retrieve data from two different tables « View previous topic :: View next topic » 
Author Message
rkford11
PostPosted: Thu Dec 09, 2004 3:38 pm    Post subject: retrieve data from two different tables Reply with quote

Partisan

Joined: 06 Jun 2004
Posts: 316

I am trying to retrieve columns from two tables an a database and combine them to produce a single message.
This is my ESQL
DECLARE MSG,MG BLOB ;
IF InputRoot.XML.ABC = 'ok' THEN
SET MSG = THE (SELECT A.col1 FROM Database.Data.test as A where A.cus_id = 1002 );
SET MG = THE (SELECT B.col2 FROM Database.Data.test1 as B where B.cus_id = 1001 );
END IF;
SET OutputRoot.XML.ABC.MESSAGE = MSG || MG ;

ESQL editor validates it fine, but it is not retrieving the database.Please correct me.

Thanks
Back to top
View user's profile Send private message
contactop
PostPosted: Thu Dec 09, 2004 3:58 pm    Post subject: Reply with quote

Acolyte

Joined: 26 Jun 2003
Posts: 50

what is the error u r getting?
Back to top
View user's profile Send private message
rkford11
PostPosted: Thu Dec 09, 2004 5:21 pm    Post subject: Reply with quote

Partisan

Joined: 06 Jun 2004
Posts: 316

contactop wrote:
what is the error u r getting?


It gives me an error saying attempt has been made to assign a scalar,row, list to a target of a different basic type.
i have my columns to be long varchar and text types.

Thanks
Back to top
View user's profile Send private message
kirani
PostPosted: Thu Dec 09, 2004 6:02 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

You should use ITEM keyword. For example,
Code:

SET MSG = THE (SELECT ITEM A.col1 FROM Database.Data.test as A where A.cus_id = 1002 );
SET MG = THE (SELECT ITEM B.col2 FROM Database.Data.test1 as B where B.cus_id = 1001 );

_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » retrieve data from two different tables
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.