
Hi All,
I am getting this error while calling a query in stored procedure connector.
ERROR 2019-06-16 14:29:14,150 [[MuleRuntime].io.03: [db].dbFlow.BLOCKING @87b1ab9] [event: ad4a3ca0-9014-11e9-9e71-e8039aac9b96] org.mule.runtime.core.internal.exception.OnErrorPropagateHandler:
********************************************************************************
Message : Parameter index of 3 is out of range (1, 2).
Error type : DB:QUERY_EXECUTION
Element : dbFlow/processors/1 @ db:db.xml:18 (Stored procedure)
Element XML :
My stored procedure works fine when there is no out parameters, but it fails with above error when I add an out parameter in the stored procedure.
Below is my DB connector config:
<db:stored-procedure doc:name="Stored procedure" doc:id="6cb6b9be-3809-46e9-9776-db9a41738202" config-ref="Database_Config">
<db:sql >{call status (:pnam, :lnam, :result)}</db:sql>
<db:input-parameters ><![CDATA[# [{
'pnam': attributes.queryParams.f,
'lnam': attributes.queryParams.l
}]] ]></db:input-parameters>
<db:output-parameters >
<db:output-parameter key="result" type="VARCHAR" />
</db:output-parameters>
</db:stored-procedure>
And here is my stored procedure config:
CREATE DEFINER=`root`@`localhost` PROCEDURE `stat`(IN district VARCHAR(10), IN project VARCHAR(10), out result VARCHAR(10))
BEGIN
select pid into result from db.prod where pname = district and pfeature = project;
END
Any help here would be appreciated.
Regards,
Tanmay