Author |
Message
|
arvind24_s |
Posted: Tue Sep 18, 2007 3:55 am Post subject: ESQl Error |
|
|
 Newbie
Joined: 17 Sep 2007 Posts: 9 Location: India
|
Hi
I am trying to parse a input XML file which contains repeating sections and create multiple output messages which are posted to a MQ queue , each message correpsonding to each of the repeating elements. I am using Websphere MEssage Broker v 6.0.2
The structure of my main xml is as follows
<CSV>
<customer>
<firstname>Bob</firstname>
<lastname>Dyson</lastname>
</customer>
<customer>
<firstname>Alen</firstname>
<lastname>Dwayne</lastname>
</customer>
</CSV>
where each customer section need to be outputted as a MQ message
The following is the ESQL code i am using in a compute node
DECLARE counter INTEGER 1;
DECLARE count INTEGER CARDINALITY(InputRoot.XML.CSV_1.customer[]);
WHILE (counter <= count)DO
CALL CopyMessageHeaders();
SET OutputRoot.XML.CSV_1.customer[counter] = InputRoot.XML.CSV_1.customer[counter];
SET counter = counter+1;
PROPAGATE;
END WHILE;
I get the following exception
(
(0x01000000):RecoverableException = (
(0x03000000):File = 'F:\build\S600_P\src\DataFlowEngine\ImbComputeNode.cpp'
(0x03000000):Line = 464
(0x03000000):Function = 'ImbComputeNode::evaluate'
(0x03000000):Type = 'ComIbmComputeNode'
(0x03000000):Name = 'CSV2XML#FCMComposite_1_16'
(0x03000000):Label = 'CSV2XML.Compute'
(0x03000000):Catalog = 'BIPv600'
(0x03000000):Severity = 3
(0x03000000):Number = 2230
(0x03000000):Text = 'Caught exception and rethrowing'
(0x01000000):RecoverableException = (
(0x03000000):File = 'F:\build\S600_P\src\DataFlowEngine\ImbRdl\ImbRdlStatementGroup.cpp'
(0x03000000):Line = 589
(0x03000000):Function = 'SqlStatementGroup::execute'
(0x03000000):Type = 'ComIbmComputeNode'
(0x03000000):Name = 'CSV2XML#FCMComposite_1_16'
(0x03000000):Label = 'CSV2XML.Compute'
(0x03000000):Catalog = 'BIPv600'
(0x03000000):Severity = 3
(0x03000000):Number = 2488
(0x03000000):Text = 'Error detected, rethrowing'
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = '.ParseXML.Main'
)
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = '13.1'
)
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = 'SET OutputRoot.XML.CSV_1.customer[counter] = InputRoot.XML.CSV_1.customer[counter];'
)
(0x01000000):RecoverableException = (
(0x03000000):File = 'F:\build\S600_P\src\DataFlowEngine\ImbRdl\ImbRdlFieldRef.cpp'
(0x03000000):Line = 912
(0x03000000):Function = 'SqlPathElement::navigateCursorFirst'
(0x03000000):Type = ''
(0x03000000):Name = ''
(0x03000000):Label = ''
(0x03000000):Catalog = 'BIPv600'
(0x03000000):Severity = 3
(0x03000000):Number = 2436
(0x03000000):Text = 'Array subscript error'
(0x01000000):Insert = (
(0x03000000):Type = 2
(0x03000000):Text = '2'
)
Any help on this will be greatly appreciated
Thanks |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Sep 18, 2007 4:15 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You don't need counter on OutputRoot.XML.CSV_1.customer. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
arvind24_s |
Posted: Tue Sep 18, 2007 4:35 am Post subject: Re |
|
|
 Newbie
Joined: 17 Sep 2007 Posts: 9 Location: India
|
Thanks for the suggestion
I tried it out and now the exception doesnt occur.
however, given a input file containing the following
Bob,Dyson,1 Desolation Row,Orlando,FL,32802,HYT-457-AX
Jimmy ,Pace,1002 Misty Mountain Drive,New York,NY,10001,ADU-239-BX
only 1 message is added to the output queue
<customer>
<firstname>Jimmy </firstname>
<lastname>Pace</lastname>
</customer>
The xml snippet corresponding to the first record is not outputted to the queue. As part of this message flow, i am transforming a CSV file into an XML files with each record of the CSV being written as a XML message on a output queue
Please advice
Thanks |
|
Back to top |
|
 |
datspats |
Posted: Tue Sep 18, 2007 5:02 am Post subject: |
|
|
Voyager
Joined: 12 Apr 2007 Posts: 80 Location: Mumbai
|
can you pleae try
SET OutputRoot.XML.CSV_1.customer[1] = InputRoot.XML.CSV_1.customer[counter]; in the loop |
|
Back to top |
|
 |
arvind24_s |
Posted: Tue Sep 18, 2007 8:54 pm Post subject: |
|
|
 Newbie
Joined: 17 Sep 2007 Posts: 9 Location: India
|
A small correction to the output in my second post
I now get the following exception
(
(0x01000000):RecoverableException = (
(0x03000000):File = 'F:\build\S600_P\src\DataFlowEngine\ImbMqOutputNode.cpp'
(0x03000000):Line = 782
(0x03000000):Function = 'ImbMqOutputNode::evaluate'
(0x03000000):Type = 'ComIbmMQOutputNode'
(0x03000000):Name = 'CSV2XML#FCMComposite_1_15'
(0x03000000):Label = 'CSV2XML.CSV2XML.OUT'
(0x03000000):Catalog = 'BIPv600'
(0x03000000):Severity = 3
(0x03000000):Number = 2230
(0x03000000):Text = 'Caught exception and rethrowing'
(0x01000000):MessageException = (
(0x03000000):File = 'F:\build\S600_P\src\DataFlowEngine\ImbMqOutputNode.cpp'
(0x03000000):Line = 648
(0x03000000):Function = 'ImbMqOutputNode::evaluate'
(0x03000000):Type = 'ComIbmMQOutputNode'
(0x03000000):Name = 'CSV2XML#FCMComposite_1_15'
(0x03000000):Label = 'CSV2XML.CSV2XML.OUT'
(0x03000000):Catalog = 'BIPv600'
(0x03000000):Severity = 3
(0x03000000):Number = 2660
(0x03000000):Text = 'Message contains no data'
(0x01000000):Insert = (
(0x03000000):Type = 2
(0x03000000):Text = '-1'
)
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = 'MQW001'
)
(0x01000000):Insert = (
(0x03000000):Type = 2
(0x03000000):Text = '0'
)
(0x01000000):Insert = (
(0x03000000):Type = 5
(0x03000000):Text = ''
)
)
Insipite of this exception, the multiple xml output files are added to the MQ queue as long as the catch terminal is connected for example say to a trace node.
Please advice on how to solve this exception
Last edited by arvind24_s on Tue Sep 18, 2007 9:43 pm; edited 1 time in total |
|
Back to top |
|
 |
elvis_gn |
Posted: Tue Sep 18, 2007 9:15 pm Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi arvind24_s,
arvind24_s wrote: |
(0x03000000):Text = 'Message contains no data' |
Perhaps you have a RETURN TRUE after the WHILE LOOP ?
Regards. |
|
Back to top |
|
 |
arvind24_s |
Posted: Tue Sep 18, 2007 9:44 pm Post subject: |
|
|
 Newbie
Joined: 17 Sep 2007 Posts: 9 Location: India
|
Hi Elvis
Here goes my whole method
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
DECLARE counter INTEGER 1;
DECLARE count INTEGER CARDINALITY(InputRoot.XML.CSV_1.customer[]);
WHILE (counter <= count)DO
CALL CopyMessageHeaders();
SET OutputRoot.XML.CSV_1.customer = InputRoot.XML.CSV_1.customer[counter];
SET counter = counter+1;
PROPAGATE;
END WHILE;
RETURN TRUE;
END;
Does the Return True affect/cause the exception? |
|
Back to top |
|
 |
shalabh1976 |
Posted: Tue Sep 18, 2007 10:28 pm Post subject: |
|
|
 Partisan
Joined: 18 Jul 2002 Posts: 381 Location: Gurgaon, India
|
Yes, RETURN TRUE causes this problem.
After you have come out of the loop your message tree has been deleted and you have a blank message. RETURN TRUE causes this tree to be sent to the output.
Change this to RETURN FALSE. _________________ Shalabh
IBM Cert. WMB V6.0
IBM Cert. MQ V5.3 App. Prog.
IBM Cert. DB2 9 DB Associate |
|
Back to top |
|
 |
arvind24_s |
Posted: Tue Sep 18, 2007 10:54 pm Post subject: |
|
|
 Newbie
Joined: 17 Sep 2007 Posts: 9 Location: India
|
Thanks a lot
It worked  |
|
Back to top |
|
 |
|