|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Using INTERSECT(SQL operator) in ESQL |
« View previous topic :: View next topic » |
Author |
Message
|
Lucky |
Posted: Mon Sep 17, 2012 10:30 pm Post subject: Using INTERSECT(SQL operator) in ESQL |
|
|
Apprentice
Joined: 06 Feb 2007 Posts: 35
|
Hi All,
I am using Message broker V6.0. I've a scenario where in I've to get the result set Id from a table using Intersect sql operatot.
Query I am executing is :
DECLARE Id CHAR ;
DECLARE caseNum CHAR 3301010673;
DECLARE busPermId CHAR 3301010673;
SET Id = SELECT alt.interaction_id FROM Database.interaction_logging.interaction_alternate_id as alt WHERE alt.alternate_id = caseNum
INTERSECT
(select p.interaction_id from Database.interaction_logging.interaction_alternate_id as p WHERE p.alternate_id = busPermId)
First of all I am not able to compile the code and get below error in Toolkit.
Syntax error. Valid options include: identifier BEGIN CALL CASE CREATE DECLARE DELETE ELSE ELSEIF END
EVAL FOR IDENTIFIER IF INSERT ITERATE LEAVE LOOP PASSTHRU REPEAT
RETURN UNTIL VALUES WHEN WHILE
So, is there a way of implementing SQL INTERSECT operator in ESQL or please help me solve the above error.
Thanks. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Tue Sep 18, 2012 5:13 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
You might try passthru but in any event, V6.0 is end of life for a year and a half (18 months) already. Upgrade to V8. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Sep 18, 2012 6:52 am Post subject: Re: Using INTERSECT(SQL operator) in ESQL |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Lucky wrote: |
So, is there a way of implementing SQL INTERSECT operator in ESQL |
ESQL Select doesn't support an INTERSECT operation, regardless of what version.
You should upgrade to a supported level - but it won't "solve" your "problem".
You could use PASSTHRU to use your database engine's SELECT statement, which might support INTERSECT.
Otherwise, you need to write your own code to perform an intersect of two lists. |
|
Back to top |
|
 |
NealM |
Posted: Tue Sep 18, 2012 7:45 am Post subject: |
|
|
 Master
Joined: 22 Feb 2011 Posts: 230 Location: NC or Utah (depends)
|
When you look up PASSTHRU in your v6 ESQL manual, be sure to read about both the PASSTHRU statement and the PASSTHRU function. And the function has the better example to follow. |
|
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
|
|
|
|