问题
I have a stored procedure that takes in 2 parameters and returns an integer value. I would like this value to be the value for a gauge chart on the page. The 2 parameters will change depending on the attributes of the selected item. Is there a simple way to pass the one value from the stored procedure to the chart to display? This will be embedded in an asp.net application (vb) - so depending on the previously selected item, the values for the parameters and result will change. thank you for your help.
回答1:
Create the package
CREATE OR REPLACE PACKAGE REPORTING AS type query_results is ref cursor; PROCEDURE barfoo (one IN INTEGER, two IN INTEGER, three IN OUT REPORTING.query_results);
END REPORTING;
Create the stored procedure
CREATE OR REPLACE PROCEDURE BARFOO ( one IN INTEGER DEFAULT NULL, two IN INTEGER DEFAULT NULL, three IN OUT reporting.query_results ) AS BEGIN
open three for select one + two total from dual ;
END BARFOO;
Build the report
3a. Ensure that stored procedures will be visible in the Database 'Expert'

3b. Add the stored procedure to the report

3c. Add Chart
Insert | Chart... | Type tab | Gauge, then Data tab

- The result

来源:https://stackoverflow.com/questions/10953789/using-result-from-a-stored-procedure-with-parameters-as-value-for-gauge-chart