Hi all
Perhaps I am missing something obvious, but I have searched the forum and can’t find what I am looking for.
I am creating an html report on line items across multiple sales in a mysql database. To set up the select query, I let the user do a servoy find on the fields they want. When they press the ‘report’ button, it loops through the foundset to set a ‘foundset flag’ field to 1, sets the query up (where ‘foundset_flag = 1’), and build’s an html report with the result.
I then set the foundset flag back to 0 at the end of the method.
This works very well. However… It is quite slow with large datasets (200+ records in the foundset begins to slow down and there are more than 10,000 records in the table.) It will also obviously fail if two users simultaneously run a report (since they’ll both be setting the foundset flag to 1 and then searching on it.) I know that I could set a flag to some random number, but it seems that I’m building an increasingly complex workaround to something that is probably done much more elegantly in another way.
I’d be grateful to know if there is a ‘set query by foundset’ function or something, or if there is a better way of doing this… Is there a way to identify to my SQL query what is in my foundset?
Do I need to use an array?
TIA
Bevil