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 » ESQL- SELECT Query from Multiple Database Tables

Post new topic  Reply to topic
 ESQL- SELECT Query from Multiple Database Tables « View previous topic :: View next topic » 
Author Message
sandman147
PostPosted: Tue Mar 25, 2014 6:51 am    Post subject: ESQL- SELECT Query from Multiple Database Tables Reply with quote

Apprentice

Joined: 01 Sep 2013
Posts: 42

Implementing the following Query in WMB ESQL

Code:
                     SELECT A.SOURCE_ID,                                     
                            A.FOR_ID,                                       
                            A.TRACE_NBR,                               
                            A.SEQUENCE_ID,                                   
                            A.CLIENT_ID,                             
                            A.USER_ID,                             
                            A.INVENTORY_DATE,                                   
                            B.RT_DESCRIPTION,                                       
                            A.RT_INVENTORY_NBR,                                   
                            B.RT_INVENTORY_GROSS,                               
                            B.RT_DISCOUNT_PERC,                                   
                                B.RT_INVENTORY_NET,                                                                      B.GEN_NAME,                                                                                              B.GEN_ADDR,                                                                 
                            B.GEN_CITY,                                   
                            B.GEN_STATE,                                 
                            B.GEN_ZIP,                                   
                            B.GEN_COUNTRY,                               
                            B.INVENTORY_LOC,                                   
                            B.RT_INVENTORY_AMOUNT_PAID                               
                                                                             
                     FROM REMIT A, CHK_REMIT B                         
                                                                             
                     WHERE A.SOURCE_ID     = B.SOURCE_ID                   
                       AND A.FOR_ID              = B.FOR_ID                     
                       AND A.TRACE_NBR       = B.TRACE_NBR             
                       AND A.SEQUENCE_ID    = B.SEQUENCE_ID                 
                       AND A.SOURCE_ID       = PY-SOURCE-ID                 
                       AND A.FOR_ID             = PY-FOR-ID                   
                       AND A.TRACE_NBR       = PY-TRACE-NBR     


Note: 'PY-SOURCE-ID', 'PY-FOR-ID', 'PY-TRACE-NBR' belong to PAYEE table
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Mar 25, 2014 10:14 am    Post subject: Reply with quote

Grand High Poobah

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

And was there a question here?
I don't see Payee appearing in any from clause... ..., and please next time surround your code with the "code" tags.
Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
sandman147
PostPosted: Tue Mar 25, 2014 10:46 am    Post subject: Reply with quote

Apprentice

Joined: 01 Sep 2013
Posts: 42

When attempting to run the above SELECT statement against a test database, the query wont return any values and errors out. How is the code to be modified so it may execute.
Back to top
View user's profile Send private message
Tibor
PostPosted: Wed Mar 26, 2014 1:01 am    Post subject: Reply with quote

Grand Master

Joined: 20 May 2001
Posts: 1033
Location: Hungary

You can find exciting information in the manual:

http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/topic/com.ibm.etools.mft.doc/ak05620_.htm
Back to top
View user's profile Send private message
Rix
PostPosted: Tue Apr 01, 2014 2:29 pm    Post subject: Reply with quote

Newbie

Joined: 01 Apr 2014
Posts: 3

Normally I would be thinking that references to the manual is like kicking a downed man, but Tibor is right. So many things are wrong....

# How do you define the source database?
# You need brackets after the table names... they are lists....
Back to top
View user's profile Send private message
gunjand
PostPosted: Tue Apr 01, 2014 3:13 pm    Post subject: Reply with quote

Novice

Joined: 21 May 2009
Posts: 23

Do you want to pass the payee information dynamically or you want to handle the null return?
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 » ESQL- SELECT Query from Multiple Database 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.