Python
September 7th, 2004, 05:30 AM
Hi guys!
I have a bunch of reports with parameters embedded in SQL. Until now, the parameters were substituted with real values at report generation time (so we used those reports as templates). But now, I have been told to pass the parameters via the Java Reporting Component, and the problem is that we have parameters embedded in SQL like:
SELECT ....
WHERE X=1 {CONDITION_1} AND X=3;
Now suppose CONDITION_1="AND X=2"; it gets interpolated as:
SELECT ....
WHERE X=1 'AND X=2' AND X=3;
which isnt correct SQL syntax. if I do CONDITION_1="", we have:
SELECT ....
WHERE X=1 '' AND X=3;
you get the picture...
The reports did work before because the designer edited manually the SQL.
Is there any workaround, or is it impossible to fix? Is kind of important, since we have like 200 reports in this way, and fixing them can be quite a boring/long task.
Thanks in advance,
Pablo.
I have a bunch of reports with parameters embedded in SQL. Until now, the parameters were substituted with real values at report generation time (so we used those reports as templates). But now, I have been told to pass the parameters via the Java Reporting Component, and the problem is that we have parameters embedded in SQL like:
SELECT ....
WHERE X=1 {CONDITION_1} AND X=3;
Now suppose CONDITION_1="AND X=2"; it gets interpolated as:
SELECT ....
WHERE X=1 'AND X=2' AND X=3;
which isnt correct SQL syntax. if I do CONDITION_1="", we have:
SELECT ....
WHERE X=1 '' AND X=3;
you get the picture...
The reports did work before because the designer edited manually the SQL.
Is there any workaround, or is it impossible to fix? Is kind of important, since we have like 200 reports in this way, and fixing them can be quite a boring/long task.
Thanks in advance,
Pablo.