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 » Pass a list in where clause for database query in ESQL

Post new topic  Reply to topic Goto page Previous  1, 2
 Pass a list in where clause for database query in ESQL « View previous topic :: View next topic » 
Author Message
ruchir123
PostPosted: Tue Feb 28, 2012 11:31 pm    Post subject: Reply with quote

Acolyte

Joined: 04 Jan 2012
Posts: 58

Hi All,

Thanks for your valueable time and suggestions.

With your help I figure it out.

Here is the solution i got :

Code:
DECLARE result ROW ;      
SET result.temp[1] = '03';
SET result.temp[2] = '27';
SET result.temp[3] = '07';
DECLARE str1,str2,str3 CHARACTER;
set str1 =  '''';
set str3 =  str1||result.temp[1]||str1||','||str1||result.temp[2]||str1||','||str1||result.temp[3]||str1;
set str2 = '(select t.abc from Database.table1 AS t where t.def IN  ('||str3||'))';
set result.reps2[] = EVAL(str2);
SET result.resp1[] = PASSTHRU(str2);


when i checked the str3 after its execution it is making correct string like :

Code:
select t.abc from Database.table1 AS t where t.def IN  ('03','27','07');


As per the requirement.

the issue is when it is executing EVAL i m getting desired result
but when executing PASSTHRU i m getting exception as
Quote:
[IBM][ODBC Oracle driver][Oracle]ORA-00907: missing right parenthesis


Please tell what can be the reason for failing of PASSTHRU.
Back to top
View user's profile Send private message
mgk
PostPosted: Wed Feb 29, 2012 1:59 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Quote:
Database.table1


This part is specific to ESQL and "Database." is not needed when using PASSTHRU. PASSTHRU sends the exact string you give it to the DB unchanged, so it has to be correct for your given DB.

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
ruchir123
PostPosted: Wed Feb 29, 2012 2:43 am    Post subject: Reply with quote

Acolyte

Joined: 04 Jan 2012
Posts: 58

mgk Thanks ..

I got the reason for the error. U ROCK ..
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2 Page 2 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Pass a list in where clause for database query in ESQL
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.