Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
how to set parameter value to procedures with output parameter
andlu
<p>Hi,</p><p> </p><p>I have a question but could not find the answer after searching in the forums. Really appreicate if anyone has some quick idea. </p><p> </p><p>My question is that I have a procedure with two parameters in procedure used by a birt report design file.</p><p>One parameter is input, the other is output which is the resultset returned by the procedure.</p><p> </p><p>In the java code where the report engine runs, it seems there were errors (listed below) when I set the parameters for the procedures and ran the task. I tried to set the parater individually using setParameterValue(), and <span>setParameterValues</span>(hashMap), both gave me same errors.</p><p> </p><p>It seems somehow birt IRunAndRenderTask didn't recognize the output parameter for the procedure.</p><p> </p><p>When I did preview in Birt report designer, and input an paramter, I was able to view the returned result on report successfully. The error happened in integration java code.</p><p> </p><p>code:</p><p> </p><p>IRunAndRenderTask task = engine.createRunAndRenderTask(runnable);</p><p>//1st try set parameter individually
task.setParameterValue("EMPLYEE_ID", "1918");
task.setParameterValue("PRC", ""); // There's same error no matter I set the second parameter or not
task.run();</p><p> </p><p>// 2nd try try, below code gave the same error when I used a hashmap</p><p><span>HashMap parms = new HashMap();
parms.put("EMPLYEE_ID","1918");
task.setParameterValues(parms);</span>
</p><p>//Error displayed</p><p>java.sql.SQLException: ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'GET_EMPLOYEE'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
at org.eclipse.birt.report.data.oda.jdbc.CallStatement.executeQuery(CallStatement.java:458)
at org.eclipse.birt.report.data.oda.jdbc.CallStatement.execute(CallStatement.java:605)
at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaAdvancedQuery.doExecute(OdaAdvancedQuery.java:123)
at org.eclipse.datatools.connectivity.oda.consumer.helper.OdaAdvancedQuery.execute(OdaAdvancedQuery.java:82)
at org.eclipse.birt.data.engine.odaconsumer.PreparedStatement.execute(PreparedStatement.java:570)
... 55 more</p><p> </p><p> </p><p> </p><p>CREATE OR REPLACE PROCEDURE GET_EMPLOYEE
(
EM_ID IN VARCHAR2,
prc out sys_refcursor
) AS
BEGIN
open prc for
select *
from COMPANY
where EMPLOYEE_ID = to_number(EM_ID);
END GET_EMPLOYEE;</p><p> </p><p>Environement:</p><p> birt-runtime-4_3_1</p>
Find more posts tagged with
Comments
There are no comments yet