I'm entering the fray late here, but I think I have a good, fast,
general solution, provided you're willing to index a field. I should
probably post it in U2UG's wiki the source code to the XSELECT utility
below.
Using your example, SELECT CUSTOMERS WITH CLIENTNO = "1""2""3""4"..... :
1. Maintain an index on COSTOMERS CLIENTNO.
2. Create a saved or active select list of the 300 client numbers.
Others have suggested how via QSELECT, FORM.LIST etc.
3. Use XSELECT utility verb that uses basic SELECTINDEX under the covers to
build a select list of all CUSTOMERS keys that are indexed by those 300
client numbers.
>GET.LIST A.BUNCH.OF.CLIENTS
300 records selected.
>>XSELECT CUSTOMERS CLIENTNO
12,345 records selected <--- 12,345 CUSTOMER IDs
>>LIST CUSTOMERS REQUIRE.SELECT ... ( or however you generate the
report.)
The nut of XSELECT pretty much does this:
outlist = ''
loop while readnext idxval
selectindex idx, idxval from fvar to 0
readlist temp from 0 then outlist<-1> = temp
repeat
but there's logic for oconv, duplicates, saving/getting lists, existing with
active select list, error handling, etc. that you'll need if you roll your
own.
Chuck Stevenson
On Thu, Jan 29, 2009 at 11:43 AM, Bill Haskett wrote:
> We have a report writer that allows users to select the client they want
> to
> print any report for. This subroutine builds a list of clients available
> to
> any particular user and uses this list to either compare against the
> clients
> entered or of all clients are selected then the entire list is used.
> When
> this list is placed in an ECL query and executed, e.g....
> SELECT CUSTOMERS WITH CLIENTNO = "1""2""3""4".....
> ...all has been fine for years. We picked up a new customer who has over
> 300 clients. When a user tries to run a report for all clients
> accessible
> by them the query aborts with...
> WITH condition stack overflow
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/