|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
retrieve data from two different tables |
« View previous topic :: View next topic » |
Author |
Message
|
rkford11 |
Posted: Thu Dec 09, 2004 3:38 pm Post subject: retrieve data from two different tables |
|
|
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 |
|
 |
contactop |
Posted: Thu Dec 09, 2004 3:58 pm Post subject: |
|
|
Acolyte
Joined: 26 Jun 2003 Posts: 50
|
what is the error u r getting? |
|
Back to top |
|
 |
rkford11 |
Posted: Thu Dec 09, 2004 5:21 pm Post subject: |
|
|
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 |
|
 |
kirani |
Posted: Thu Dec 09, 2004 6:02 pm Post subject: |
|
|
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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|