|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Dynamic Referencing issue |
« View previous topic :: View next topic » |
Author |
Message
|
leo> |
Posted: Thu Jan 12, 2006 10:42 am Post subject: Dynamic Referencing issue |
|
|
 Apprentice
Joined: 06 Oct 2004 Posts: 42
|
Hi All,
I facing a problem while using dynamic referencing to read a huge input file (~2 MB) that contains multiple lines of delimited data..
In a compute node, for every line in the input file I need to make an insert into a oracle table.
So my flow looks like:
Code: |
|--> FailQ
MQInputNode -----------------------> Compute Node
|--> Catch-Error handler
|
My ESQL looks like:
Code: |
WHILE(LASTMOVE(REFIN))
SET OutputRoot.MRM."Field1" = REFIN."Value1";
SET OutputRoot.MRM."Field2" = REFIN."Value2";
SET OutputRoot.MRM."Field3" = REFIN."Value3";
Set MsgBlob =
ASBITSTREAM( OutputRoot.MRM,
InputRoot.MQMD.Encoding,
InputRoot.MQMD.CodedCharSetId,
'E34JDR407Q001','Format1',
'XML',
RootBitStream);
Set Msg = Cast(MsgBlob as Char CCSID InputRoot.MQMD.CodedCharSetId);
PASSTHRU('Insert into Table1 (KEY,XML) values(null,Msg);
MOVE REFIN NEXTSIBLING;
END WHILE;
|
The problem occurs when there is no value for a field. For example, the first line in the input file, has value '10' for field2, and the second line in the input file does not have a value for field2, then field2 still retains the value it had in the previous iteration. How do I clear the values off..?
I tried putting a PROPAGATE adter the PASSTHRU call. IT WORKS. But is this the right way of clearing the old values?
Please let me know..
thanks _________________ IBM Certified System Administrator - Websphere MQ V5.3 |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Jan 12, 2006 10:47 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I really don't think you want to do a propagate, unless you want to move the insert logic into the next node.
If, instead of
Code: |
set OutputRoot.MRM."Field1" = REFIN."Value1"; |
then you do
Code: |
set OutputRoot.MRM."Field1" = COALESCE(REFIN."Value1",""); |
then I think you will be happy. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
elvis_gn |
Posted: Thu Jan 12, 2006 8:29 pm Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi leo>,
Try not to use a Passthru also, unless your insert had something which MB does not allow.
Also, ur while does not have a DO ?
Regards. |
|
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
|
|
|
|