Temp tables:
I'm afraid that changing tables is slightly harder on the fly in crystal, but not impossible I'd assume. Within Crystal you can set the data location (under database menu) and change the tables individually. Perhaps using the SDK can help you here?
About the view and external Select statement:
Yes, your first statement is correct. The view will read 100,000 records and the external Select statement will filter these 100,000 down to 100 in a seperate operation.
Anything where you query a view that does not significantly reduce the number of records compared to the original source is slower than querying the original source directly.
Note that if your view reduces the orginial source from 10,000,000,000 records to 100,000 and you query the view it might be faster then directly querying the database from an external program (select statement). This because anything executed on the database engine directly is usually faster than an external query that uses some extra layer to query the database.
Joins:
The view is obviously great for joining tables, especially from different sources or with some outer joins with ON statements as Crystal doesnt understand ON statements all too well.
Changing parameters:
Do realize that you could always use a parameter in the crystal record selection criteria like:
Code:
({?parameter1} = '*' OR {?parameter1} = {Table.FIELD1})
and
({?parameter2} = '*' OR {?parameter2} = {Table.FIELD2})
and
({?parameter3} = -1 OR {?parameter3} = {Table.MyNummericField})
Since stored procedures are not guaranteed to work by Crystal depending on the connection type (as far as I can remember) I'd avoid these.
Dynamic SQL:
If you can submit the sql for crystal to use in a crystal command using the SDK (and I dont ever use the SDK myself) this would be a very simple way of fixing the issue, especially if you cant use Crystal's normal way of using tables and linking them as with sql containing complicated joins or unions.
Hope this clear things up a bit.
And remember that your current way doesnt have to be slower then using the tables directly, but might be.