Flash Chart and Function Returning SQL Query Query Source Type
10886Oct 26 2009 — edited Nov 12 2009Hi,
I have been trying to control programmatically the queries used in flash charts, but the Function Returning SQL Query does not appear to work when it is not dealing with a literal string.
I have been using code like :
declare result varchar2(4000);;
begin
result := :P410_FC1_SELECT_QUERY;
if :P410_FC1_UB_QUERY IS NOT NULL then
result := :P410_FC1_UB_QUERY;
end if;
return result;
end;
to change the query being used, but the flash chart gives me an error. The contents of the page variables produce valid results when I run them under SQL Commands in SQL Workshop.
If I use &P410_FC1_SELECT_QUERY. as the SQL for SQL Query, the correct graph is plotted.
If I use
begin
return '&P410_FC1_UB_QUERY.';
end;
This also produces the correct chart.
For a regular tabular report using PL/SQL function body returning SQL Query with
begin
return :P410_RT1_SELECT_QUERY;
end;
I get the right tabular result, so this works when using a Page Item. Is there something different I should be doing with the Flash Chart or is this a bug or missed opportunity?
Thanks,
Peter