In the Reporting Module, I have a script that determines which table the data is in, then sets data[‘db_table’] = ‘myTable’.
Then the query runs after the script, but gives an error saying “@p0” is not defined, even if I give it a default value. The xml also shows the correct table name in the preview.
SQL will not accept schema as a parameters, so I doubt you would be able to make this work with a standard query. Assuming that I am understanding what you have in your query.
You can’t use ‘?’ substitution for table names, column names, etc. Those are schema identifiers. You have to use string substitution. In a named query, this would be a parameter of type “QueryString” instead of type “Value”.
Be aware that using strings for schema may be allowed, but it is a potential security hole. Don’t supply user-supplied strings to QueryString parameters.