Author |
Message
|
madi |
Posted: Tue May 02, 2006 11:42 am Post subject: error parsing single quotes in xml[Solved] |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
I am getting this error in a java custom node which is working fine in other places and used to work fine here
not able to find any ATS in the code
Quote: |
May 2 09:37:46 wmqux001 MQSIv500[5559]: [ID 702911 user.error] (WMQDQM01_BK.WMQDQM01_EG02)[28]BIP2230E: Error detected whilst processing a message in node 'TRB_TRIGGER_FLOW.JMQGet'. : WMQDQM01_BK.d7695eb9-0701-0000-0080-df7cf3b163d8: /build/S500_P/src/DataFlowEngine/PluginInterface/ImbJniNode.cpp: 900: ImbJniNode::evaluate: ComIbmJniNode: TRB_TRIGGER_FLOW#FCMComposite_1_4.TRB_INO_OTB_SA_FLOW#FCMComposite_1_3
Syntax error : expected 'AS' but found 'ATS'. : WMQDQM01_BK.d7695eb9-0701-0000-0080-df7cf3b163d8: /build/S500_P/src/DataFlowEngine/ImbRdl/ImbRdlRdp.cpp: 3085: Parser::castFunction: ComIbmJniNode: TRB_TRIGGER_FLOW#FCMComposite_1_4.TRB_INO_OTB_SA_FLOW#FCMComposite_1_3
May 2 09:37:46 wmqux001 MQSIv500[5559]: [ID 702911 user.error] (WMQDQM01_BK.WMQDQM01_EG02)[28]BIP2232E: Error detected whilst handling a previous error in node 'TRB_TRIGGER_FLOW.TGT_WBI_ERR_EnvVar_MsgFlow.Throw'. : WMQDQM01_BK.d7695eb9-0701-0000-0080-df7cf3b163d8: /build/S500_P/src/DataFlowEngine/ImbDataFlowNode.cpp: 387: ImbDataFlowNode::logExceptionList: ComIbmThrowNode: TRB_TRIGGER_FLOW#FCMComposite_1_21.TGT_WBI_ERR_EnvVar_MsgFlow#FCMComposite_1_3
|
plz help
madi
Last edited by madi on Wed May 03, 2006 6:13 pm; edited 3 times in total |
|
Back to top |
|
 |
madi |
Posted: Tue May 02, 2006 12:26 pm Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
just saw that the data had this in one of the tags, is this a problem
Code: |
<Text>Order Qty GT 'ATS'</Text> |
--madi |
|
Back to top |
|
 |
madi |
Posted: Tue May 02, 2006 1:14 pm Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
is there a way to escape single quote in eSQL??
i mean can I have
DECLARE FADF CHAR 'asfaf 'dfadf' vsdv';
this is causing major problem for us
--madi |
|
Back to top |
|
 |
sirsi |
Posted: Tue May 02, 2006 1:23 pm Post subject: |
|
|
Disciple
Joined: 11 Mar 2005 Posts: 177
|
From ESQL pdf:-
Quote: |
ESQL CHARACTER data type
The character data type holds a variable length string of Unicode characters. A character string literal consists of any number of characters in single quotation marks. If you want to include a single quotation mark within a character string literal, use another single quotation mark as an escape character. For example, the assignment SET X=’he’’was’’’ puts the value he’was’ into X. |
|
|
Back to top |
|
 |
madi |
Posted: Tue May 02, 2006 7:00 pm Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
yeah but im getting 'asa' in the input xml and i should be able to handle it and reproduce it in the output without getting an exception
any ideas??
thanks for your help
madi |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue May 02, 2006 7:53 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
The first thing to confirm is that it is valid to have this data in XML in the first place - if the XMl is invalid, broker won't handle it.
So see if, for example, Internet Explorer can parse this data.
Then, if that works, you need to explain better what you are trying to do, and where the exception is being thrown. You say you're using a Java custom node - how are you trying to handle the data you receive from the MB API?
That is, at what point of code inside your custom node is this error being thrown? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
madi |
Posted: Wed May 03, 2006 6:31 am Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
yes the xml is valid, IE can parse it and so can XMLSpy.
I have a custom node that picks up messages from a queue and passes them to broker as blobs in environment.
Hen i pick them up from there in a compute node and parse them into xml and do something else.
the java code that is giving an error is:
Code: |
String data=((TextMessage)jmsMsg).getText();
String sql="SET Environment.Variables.JMQGet.msg"+msgsRead +
"=CAST('"+ data +
"' AS BLOB CCSID InputRoot.MQMD.CodedCharSetId ) ;";
MbSQLStatement stmt=createSQLStatement(dataSource,sql); |
so if we have single quotes in the input xml it is bombing when it trying to execute the SQL stmt
--madi |
|
Back to top |
|
 |
kimbert |
Posted: Wed May 03, 2006 6:47 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
A small point but an important one: other users of this forum like to seach for things in the subject line. 'error' is not a very descriptive subject line  |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed May 03, 2006 3:27 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Okay, so you need to write java code to remove ' from your "msgsRead" variable before you execute the statement, or from your "sql" variable before you execute the statement. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
madi |
Posted: Wed May 03, 2006 6:13 pm Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
yeah so I put in the java code to replace the single quotes with two single quotes so that the SQL can escape it
thanks for the help
--madi |
|
Back to top |
|
 |
|