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 » SQL Question

Post new topic  Reply to topic
 SQL Question « View previous topic :: View next topic » 
Author Message
Lisa
PostPosted: Mon Nov 10, 2008 7:33 am    Post subject: SQL Question Reply with quote

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
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Mon Nov 10, 2008 7:37 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

There is no ORDER BY in ESQL Select.
Back to top
View user's profile Send private message
Lisa
PostPosted: Mon Nov 10, 2008 7:42 am    Post subject: SQL Question Reply with quote

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
View user's profile Send private message Send e-mail
wraymore
PostPosted: Mon Nov 10, 2008 9:02 am    Post subject: Reply with quote

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
View user's profile Send private message
Lisa
PostPosted: Mon Nov 10, 2008 10:20 am    Post subject: SQL Question Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » SQL Question
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.