|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
ESQL WHERE Clause |
« View previous topic :: View next topic » |
Author |
Message
|
kayhansefat |
Posted: Fri Mar 30, 2007 2:40 am Post subject: ESQL WHERE Clause |
|
|
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 |
|
 |
kayhansefat |
Posted: Fri Mar 30, 2007 3:07 am Post subject: |
|
|
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 |
|
 |
vk |
Posted: Fri Mar 30, 2007 6:53 am Post subject: |
|
|
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 |
|
 |
kayhansefat |
Posted: Mon Apr 02, 2007 3:21 am Post subject: |
|
|
Acolyte
Joined: 18 Oct 2006 Posts: 65
|
Yep got it working, thanks. |
|
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
|
|
|
|