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 » Multiple IN's in WHERE IN search condition

Post new topic  Reply to topic
 Multiple IN's in WHERE IN search condition « View previous topic :: View next topic » 
Author Message
billybong
PostPosted: Tue Oct 04, 2005 11:26 pm    Post subject: Multiple IN's in WHERE IN search condition Reply with quote

Disciple

Joined: 22 Jul 2005
Posts: 150
Location: Stockholm, Sweden

More of a database question I guess, but is it possible to use multiple where in's in nested select queries? I was considering something like this:

WHERE x AND y IN(SELECT table1.x, table2.y FROM ......etc )

Or do I have to write separate WHERE conditions for each, like this:

WHERE x IN(SELECT etc....)
AND y IN(SELECT etc....)

Please dont give me any RTFM answers, and if you must, please be nice
Back to top
View user's profile Send private message Visit poster's website
mgk
PostPosted: Wed Oct 05, 2005 12:08 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Hi,

Well did you try it before you posted? Which version / csd are you trying to do this? (SELECT is MUCH better in V5 than in V2.1 and also is MUCH better in V6 than in V5, so by definition is a whole universe better in V6 than in V2.1 ).

It be ok in V5 and V6, I have not tried it myself though...


Regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
billybong
PostPosted: Wed Oct 05, 2005 12:17 am    Post subject: Reply with quote

Disciple

Joined: 22 Jul 2005
Posts: 150
Location: Stockholm, Sweden

Ive tried using both AND and , to separate and neither works.
Right now I have to do two separate queries using exactly the same nested SELECT cases in order to tie the query together. It works, but it seems such an ineffective way of doing it.

BTW, I'm using version 5 csd 3
Back to top
View user's profile Send private message Visit poster's website
mgk
PostPosted: Wed Oct 05, 2005 1:12 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Can you post your actualy ESQL please
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
billybong
PostPosted: Wed Oct 05, 2005 1:41 am    Post subject: Reply with quote

Disciple

Joined: 22 Jul 2005
Posts: 150
Location: Stockholm, Sweden

SET Environment.Variables.Temp.Bookings[] =
(SELECT AKTTAG0.REF_NO, AKTTAG0.INSTR_SEQ_NO
FROM Database.AKTTAG0 AS AKTTAG0, Database.AKTTAF0 AS AKTTAF0
WHERE AKTTAG0.REF_NO = AKTTAF0.REF_NO
AND SUBSTRING(AKTTAG0.acct_no FROM 5 FOR 2) = Environment.Variables.Bookings.BookingGroup[I].ACCT
AND AKTTAG0.DEB_CRE_CODE = Environment.Variables.Bookings.BookingGroup[I].DEB_CRE_CODE
AND AKTTAG0.STATUS = 'Pending'
AND AKTTAF0.CURR_CODE = Environment.Variables.Bookings.BookingGroup[I].CURR_CODE);

UPDATE Database.AKTTAG0 as AKTTAG0
SET REPORT_ID = Environment.Variables.Bookings.BookingGroup[I].REPORT_ID
WHERE AKTTAG0.REF_NO = Environment.Variables.Temp.Bookings.REF_NO
AND AKTTAG0.INSTR_SEQ_NO = Environment.Variables.Temp.Bookings.INSTR_SEQ_NO;


As you can see I'm using a temporary environment tree to store the keys in when it would be much simpler to use a nested select statement in the update.
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 » Multiple IN's in WHERE IN search condition
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.