Posted: Mon Sep 14, 2009 9:34 am Post subject: Limiting database rows on Database node WMB6.0
Acolyte
Joined: 04 Oct 2007 Posts: 59
Hi,
I am trying to work on a message flow that would retrieve rows from a database table, generate an output structure for each retrieved row and then update a particular column of that row to mark it as "processed".
I could use a database node (which effectively is just a Compute node) to retrieve and then have a compute node to create the output structure and then use a database node to update the row.
However, if there are a lot of rows on the database (say 10K or 100K), how can i limit the number of rows retrieved ?
Is there an alternate solution to this instead of using Database node?
Note: I am using WMB 6.0 and hence cannot use the Database Retrieve node (present on WMB 6.1).
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
I'd think about using PASSTHRU and formulating an SQL Command in the versions of SQL that is being used by the database (yes there are differences)
In SQL Server something like
select top 20 from .... where .... and processed = 'False'
This would limit the select to the first 20 rows.
Then you could process them as you wish.
Finally you can build an update statement to turn processed = 'True' _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
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