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 » ESQL WHERE Clause

Post new topic  Reply to topic
 ESQL WHERE Clause « View previous topic :: View next topic » 
Author Message
kayhansefat
PostPosted: Fri Mar 30, 2007 2:40 am    Post subject: ESQL WHERE Clause Reply with quote

Acolyte

Joined: 18 Oct 2006
Posts: 65

I am accessing a database within a JavaCompute node via the MbSQLStatement class. It works fine when doing a standard SELECT * FROM, but I get an SQL error when I insert the below WHERE clause:

Code:
MbSQLStatement state = createSQLStatement("DEFBKDB6","SET OutputRoot.XML.data[] = PASSTHRU
('SELECT * FROM GPSENT_LETTERS WHERE LETTER_ECAMISID=" + "111111" + "');");


Am I forming it incorrectly?
Back to top
View user's profile Send private message
kayhansefat
PostPosted: Fri Mar 30, 2007 3:07 am    Post subject: Reply with quote

Acolyte

Joined: 18 Oct 2006
Posts: 65

The error text states, "The data types of the operands for the operation "=" are not compatible". The field LETTER_ECAMISID is a CHARACTER Data Type of length 50.

Do I have to map the "111111" somehow? Thanks.
Back to top
View user's profile Send private message
vk
PostPosted: Fri Mar 30, 2007 6:53 am    Post subject: Reply with quote

Partisan

Joined: 20 Sep 2005
Posts: 302
Location: Houston

Try putting single quotes before and after 111111.

In plain ESQL, this is how literal values are given in a PASSTHRU command -

PASSTHRU
('SELECT T.* FROM GPSENT_LETTERS AS T WHERE T.LETTER_ECAMISID= ''111111''')

In ESQL, the escape character for single quote is another single quote.

Regards,
VK.
Back to top
View user's profile Send private message
kayhansefat
PostPosted: Mon Apr 02, 2007 3:21 am    Post subject: Reply with quote

Acolyte

Joined: 18 Oct 2006
Posts: 65

Yep got it working, thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

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