Retrieves the parameters from a saved search and combines them with the menuitem's SQL.
The menu item in question can not use auto parameters (, , etc.) other than session variables, and the values of those session variables must be provided when calling the function.
The menu item's stored procedure must use sp_executesql rather than EXEC if it uses dynamic SQL, or you risk security holes from SQL injection.
A SQL string ready to be executed.
If the saved search contains parameters marked as obsolete then the return value is undefined.