Posted: Fri Jun 27, 2014 2:26 am Post subject: fetching n rows from the db
Newbie
Joined: 27 Jun 2014 Posts: 1
I am using DatabaseInput node to read the records/Events from the oracle db. I want to fetch n records from the db based on some condition. But i am unable to do it. In ReadEvent I use:
SET NewEvents.Event[] = SELECT AE_EVENT_STORE.* AS Usr, AE_EVENT_STORE.PRIMARYKEY AS Key FROM CMS_MELLON.AE_EVENT_STORE
WHERE AE_EVENT_STORE.BATCH_FLAG = 'I' AND (AE_EVENT_STORE.PROCESSED IS NULL OR AE_EVENT_STORE.PROCESSED = 'N')AND ROWNUM<=100;
In BuildMessage i write:
SET Root.DataObject.AE_EVENT_DATA[] = SELECT AE_EVENT_DATA.* FROM Database.CMS_MELLON.AE_EVENT_DATA WHERE AE_EVENT_DATA.CONTEXTIDGUID = DispatchedEvent.Usr.PRIMARYKEY;
Here I want to fetch 100 records only, but my code does not work. Please reply.
While smdavies99's suggestion is helpful, it may not actually apply here.
BuildMessage is going to be called once for each individual Event that you put into NewEvent.
What you are doing in your ReadEvent is fetching N rows each DatabaseInput node polling interval and sending each row to BuildMessage to be propagated out of DatabaseInput node.
So if you want each message propagated out of DatabaseInput to contain N rows, then you need to change the query in BuildMessage to use N rows, rather than using ReadEvent.
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