|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
SQL Question |
« View previous topic :: View next topic » |
Author |
Message
|
Lisa |
Posted: Mon Nov 10, 2008 7:33 am Post subject: SQL Question |
|
|
Master
Joined: 07 Jun 2002 Posts: 287 Location: NJ
|
Hi All,
I'm trying to get this query to work in WMB 6.0 and it fails.
Can someone help me with this issue?
This works in the UDB2 control center, but fails to compile in Toolkit.
SELECT a.ENTITY_ID, a.CITY, a.COUNTRY, a.COMMENTS, a.REMARKS
FROM Mytable AS a
WHERE a.SEQUENCE_ID = 1 and a.ENTITY_ID not in (select b.ENTITY_ID from
Mytable as b where b.SEQUENCE_ID = a.SEQUENCE_ID + 1 ) ORDER BY a.ENTITY_ID;
I'm receiving error message
Severity Description
2 Syntax error. Valid options include: || / = >= > <= < - <> + ; *
AND BETWEEN DAY HOUR IN IS LIKE MINUTE MONTH NOT
OR SECOND YEAR SCANMLRPT.esql SCANML_MF line 243 November 10, 2008 10:31:21 AM |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Nov 10, 2008 7:37 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
There is no ORDER BY in ESQL Select. |
|
Back to top |
|
 |
Lisa |
Posted: Mon Nov 10, 2008 7:42 am Post subject: SQL Question |
|
|
Master
Joined: 07 Jun 2002 Posts: 287 Location: NJ
|
Thanks for the response!
I dropped the Order by statement and tried to deploy the message flow and I received the following error. It does not like the 'in'.
SELECT a.ENTITY_ID, a.CITY, a.COUNTRY, a.COMMENTS, a.REMARKS
FROM Mytable AS a
WHERE a.SEQUENCE_ID = 1 and a.ENTITY_ID not in (select b.ENTITY_ID from
Mytable as b where b.SEQUENCE_ID = a.SEQUENCE_ID + 1 );
BIP2467E: (SCANMRPTL.Processing, {1}) : Incompatible operands for IN predicate.
The values on the right of an IN predicate must be compatible with the data type of the expression on the left.
Correct the syntax of your ESQL expression in node 'SCANMRPTL.Processing', around line and column '{1}', then redeploy the message flow. |
|
Back to top |
|
 |
wraymore |
Posted: Mon Nov 10, 2008 9:02 am Post subject: |
|
|
Centurion
Joined: 16 Aug 2005 Posts: 114 Location: Burlington, NC USA
|
I am assuming that your intent is to query a database from within the ESQL. If you need to use the Order By clause imbed your select statement within a PASSTHRU. I also know that usage of the "IN" predicate works with the PASSTHRU statement.
PASSTHRU ('SELECT a.ENTITY_ID, a.CITY, a.COUNTRY, a.COMMENTS, a.REMARKS FROM Mytable AS a
WHERE a.SEQUENCE_ID = 1 and a.ENTITY_ID not in (select b.ENTITY_ID from Mytable as b where b.SEQUENCE_ID = a.SEQUENCE_ID + 1 )') |
|
Back to top |
|
 |
Lisa |
Posted: Mon Nov 10, 2008 10:20 am Post subject: SQL Question |
|
|
Master
Joined: 07 Jun 2002 Posts: 287 Location: NJ
|
Thanks Wraymore,
I tried your solution and everything is working!
Thanks so much,
Lisa |
|
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
|
|
|
|