Quantcast
Channel: VBForums - Database Development
Viewing all articles
Browse latest Browse all 2918

Is there a limit to IN clause size?

$
0
0
:wave:
I'm not actually in the coding phase of this yet - it's more of a design issue.

I have a situation in my application where there is a datagridview with several thousand rows. Right now we filters the rows by applying a filter to the underlying datatable's default view. All of our current filters are relatively short - i.e. 'where field1 is null' or 'where field2 =7'. The customer, however, has requested the ability to select items from a map and filter the grid for the selected items. Each item on the map has a unique id that can be applied back to the grid for filtering. From what I've read online, this will work fine as long as the user only selects a few items, but if they select dozens or hundreds of items, the IN clause of the filter will be too long and a stack overflow error will occur.

So... My thought was that I can let the user select from the map first, and then filter the records in the query string that I send to the database. I can then take the resulting records and load the grid.

But will the database experience the same problem as the dataview's filter property? That is, will it reach a point where it says 'there are too many items in this IN clause - I can't handle this.' The question is further complicated by the fact that my backend database could be Access, SqlServer, or Oracle.

any ideas?

Viewing all articles
Browse latest Browse all 2918

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>