|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
Pass a list in where clause for database query in ESQL |
« View previous topic :: View next topic » |
Author |
Message
|
ruchir123 |
Posted: Tue Feb 28, 2012 11:31 pm Post subject: |
|
|
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 |
|
 |
mgk |
Posted: Wed Feb 29, 2012 1:59 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
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 |
|
 |
ruchir123 |
Posted: Wed Feb 29, 2012 2:43 am Post subject: |
|
|
Acolyte
Joined: 04 Jan 2012 Posts: 58
|
mgk Thanks ..
I got the reason for the error. U ROCK ..  |
|
Back to top |
|
 |
|
|
|
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
|
|
|
|