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 » using filter node...

Post new topic  Reply to topic
 using filter node... « View previous topic :: View next topic » 
Author Message
Seagull
PostPosted: Tue Dec 18, 2007 7:56 am    Post subject: using filter node... Reply with quote

Novice

Joined: 05 Feb 2007
Posts: 11

I am using the filter node and this esql code as to acheive a database query and an update along with an Insert.

The input message will have a header and Line details(array).I have check the the different tables in database and update them/insert into them according the existene of a number.

DATABASE NAME: DEVDTA
TABLE1 NAME: D4401
TABLE2 NAME: D3301
TABLE3 NAME: D4401Z
TABLE4 NAME: D3301Z

Column1= TRNUM-------------------(Number)
Column2 = TRIST-------------------(Initial status)
Column2 = TRFST-------------------(Final status)





CREATE FILTER MODULE DATABASE_Filter

CREATE FUNCTION Main() RETURNS BOOLEAN

BEGIN



IF (EXIST(SELECT T.TRNUM FROM DEVDTA.D4401 AS T,

WHERE T.TRNUM = InputRoot.XMLNSC.Company.Header.OrderNumber)) THEN



//IF Order number exists then modify the record

update Database.D3301 AS T

SET TRIST = InputRoot.XMLNSC.Company.LineDetails.InitialStatus[] WHERE T.TRNUM = InputRoot.XMLNSC.Company.Header.OrderNumber;
SET TRFST = InputRoot.XMLNSC.Company.LineDetails.FinalStatus[] WHERE T.TRNUM = InputRoot.XMLNSC.Company.Header.OrderNumber;


RETURN TRUE;

ELSE

//if the Order Number does n't exists at all

INSERT INTO DEVDTA.D4401Z (TRIST,TRFST) values (InputRoot.XMLNSC.Company.LineDetails.InitialStatus[],InputRoot.XMLNSC.Company.LineDetails.FinalStatus[]);
INSERT INTO DEVDTA.D3301Z (TRIST,TRFST) values (InputRoot.XMLNSC.Company.LineDetails.InitialStatus[],InputRoot.XMLNSC.Company.LineDetails.FinalStatus[]);



END IF;

END;

END MODULE;


Anything else I need to take care as I am dealing with an array input and as per code I will be updating/inserting the number of times the array is iterated.
Is my approach correct ? Please let me know if I have made any mistakes or should consider other factors too?

Thanks in adavance.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Dec 18, 2007 8:56 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

There are no arrays in ESQL, only trees.

If that code passes syntax checking, exactly as entered... it may not work the way you want it to during runtime.

You can construct your code in such a way that you have one node that does a loop/propagate and the next one does everything based on a single line.

Or you can construct your code to do everything in one node.
_________________
I am *not* the model of the modern major general.
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 » using filter node...
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.