In a message dated 98-06-09 10:28:18 EDT, you write:
I am using a personal dataset (Excel Spreadsheet) to provide a list of
values for a select query. The query will provide data for selected rows based on the key value contained in the spreadsheet. I believe, but cannot confirm, that the list that is used from this personal data set is limited to 255 entries. I need to query about 5000 values.
5,000 values?
Doug, I would imagine that there is a more effective way to identify your criteria than having an “In List” with 5,000 entries in it. Even if it were possible to pass a list of that size to the database, I suspect that the execution time would be terrible.
Is it possible to identify these entries using a series of ranges? In other words, if you are looking for items from 1000-1250, then 1270-1300, then 1305-1500, then… (you get the idea) a series of BETWEEN operations combined with an OR will not only be more feasible but much more efficient when processed by the database engine. Something like:
code between 1000 and 1250
0r code between 1270 and 1300
or code between 1305 and 1500
Obviously if your individual entries cannot be grouped in ranges, then this is not a valid solution.
Can the rows be identified with an additional table in the database? In this case, lets imagine that your list of 5,000 entries is a list of customer ID’s. You have 1,000,000 customers, so this list represents a statistical sample. By building a table called SAMPLE_CUST with a structure like:
customer_id number(10)
sample_code character(5)
… then you could create entries in the table in the database and identify them by sample_code. Your list of 5,000 customers could be called SAMP1, while another set of customers for some other project could be called SAMP2, and so on. This table would be joined to the regular customer table via the customer_id field, which should be efficient because you would (should!) have a unique index on the customer.customer_id field.
To create your query, then, you would build a condition on the Sample Code object with an Equal To ‘SAMP1’ clause. Instead of a massive “In List” you have a straight forward (and much more efficient) join.
In other words, I am having a hard time imagining a scenario where I would want to have a conditional list with 5,000 values. Perhaps you can share some more details? Or perhaps one of these ideas will help as is.
Regards,
Dave Rathbun
Integra Solutions
www.islink.com
See you in Orlando in '98!
Listserv Archives (BOB member since 2002-06-25)