Search code examples
muleanypoint-studiomule-esbmule4

Calling an Oracle function in mule 4


How do I get the return value from an Oracle funtion with named parameters?

I am using

<db:stored-procedure doc:name="Stored procedure" doc:id="607a27d0-0738-406b-900d-9490e3026c9a" config-ref="Database_Config">
        <db:sql >:result = call ib_gate.Listen_New(:i_Command,:i_Client_Id,:i_Params,:o_Err_Code,:o_Err_Msg)</db:sql>   
        <db:input-parameters ><![CDATA[#[{'i_Command' : 'GET_DATA','i_Client_Id' : -1,'i_Params' : 'ID:386075'}]]]>
        </db:input-parameters>
        <db:output-parameters>
            <db:output-parameter key="result" type="VARCHAR"/>
            <db:output-parameter key="o_Err_Code" type="VARCHAR"/>
            <db:output-parameter key="o_Err_Msg" type="VARCHAR"/>
        </db:output-parameters>
</db:stored-procedure>

but this return an error ORA-00900: invalid SQL statement


Solution

  • It was necessary to use brackets ({}) here:

    <db:sql>{:result = call ib_gate.Listen_New(:i_Command,:i_Client_Id,:i_Params,:o_Err_Code,:o_Err_Msg)}</db:sql>