Hi, this is an complex one...
We have many Stored Procedures (SPs) reporting on many tables dependant on many criteria. The criteria for each SP can vary wildly.
So, we gave EVERY SP a parameter called @vcWHEREClause(8000)
This the gets concatonated into the SQL inside the SP.
Crystal 7 reports on these SPs through OLE.
VB6 calls the report doc, passing in a complete WHERE clause as a varchar through a crystal parameter to the SP.
THE PROBLEM
Crystal %-( does not support string parameters longer than 254 characters. Out VB app Dr. Watsons if you pass in a string longer than 267 to Crystal.
Possible solutions we have though of.
1. Have several WHERE clause parameters of type VARCHAR(267) and pass in a chopped up WHERE clause.
2. Have a 2D array of 267x(FLOOR(LEN(<WHERE Clause>)/267)) and concatonate them in a loop inside the SP
3. Hard code every possible criteria into every SP (Pain)
4. Something to do with writing the Criteria to a temp table and then telling the SP where it all is.
Somebody please help me....
tons of cheers,
Jim.
We have many Stored Procedures (SPs) reporting on many tables dependant on many criteria. The criteria for each SP can vary wildly.
So, we gave EVERY SP a parameter called @vcWHEREClause(8000)
This the gets concatonated into the SQL inside the SP.
Crystal 7 reports on these SPs through OLE.
VB6 calls the report doc, passing in a complete WHERE clause as a varchar through a crystal parameter to the SP.
THE PROBLEM
Crystal %-( does not support string parameters longer than 254 characters. Out VB app Dr. Watsons if you pass in a string longer than 267 to Crystal.
Possible solutions we have though of.
1. Have several WHERE clause parameters of type VARCHAR(267) and pass in a chopped up WHERE clause.
2. Have a 2D array of 267x(FLOOR(LEN(<WHERE Clause>)/267)) and concatonate them in a loop inside the SP
3. Hard code every possible criteria into every SP (Pain)
4. Something to do with writing the Criteria to a temp table and then telling the SP where it all is.
Somebody please help me....
tons of cheers,
Jim.