Forum Discussion
Paginated Reports, Not all variables bound
- 5 years ago
Hi
instead of using :Parametername, use ? (Question Mark). Usually ODBC look for ? wherever you need to define the parameters.
SELECT
*
FROM <table_1>WHERE <field_1> BETWEEN ? AND ?
AND (<field_2>=? or <field_3>= ? or <field_4>=? or <field_5>= ?);Map the ? with appropriate variables in Parameters section of the dataset.
Thanks
Hari
Solution: Within Oracle, pump the parameter's value into a CTE (WITH Clause), cross join that into your query, and access it from there. Report Builder and Paginated Reports seem to have their own SQL compiler that isn't 100% compatible. For example, real numbers will cause a strange error.
Example:
WITH w_Variables as (SELECT :param1 as myParam from dual)
SELECT sysdate as A_Date, w_Variables.myParam
FROM dual
CROSS JOIN w_Variables
WHERE w_Variables.myParam = 'Y'
-- Answering 'Y' will return a result, answering anything else won't.
<RANT>I've developed hundreds of reports and now suddenly, this. Must have been part of my laptop reload last month when I reloade deverything. MICROSOFT, TEST YOUR ....</RANT> LOL