I need to insert current datetime into oracle database via a storedprocedure call. I tried #[server.dateTime]. Also tried #[function:date] but both are failing with below error
Message : Invalid conversion requested (java.sql.SQLException).
SQL Code : 17132
Payload Type : org.mule.util.CaseInsensitiveHashMap
SQL State : 99999
Below is my config. Thanks for any help.
<batch:step name="UpdateDatabase">
<db:stored-procedure config-ref="Oracle_Configuration" doc:name="UpdateDatabase">
<db:parameterized-query><![CDATA[{call
tokens.UpdateData(:P_ID,:P_TOKEN,:P_CC,:P_DATE_UPDATED,:P_UPDATED_BY,:P_RESULT)}]]></db:parameterized-query>
<db:in-param name="P_ID" type="INTEGER" value="123456"/>
<db:in-param name="P_TOKEN" type="VARCHAR" value="test_token"/>
<db:in-param name="P_CC" type="VARCHAR" value="test_cc"/>
<db:in-param name="P_DATE_UPDATED" type="DATE" value="#
[server.dateTime]"/>
<db:in-param name="P_UPDATED_BY" type="VARCHAR" value="migrator"/>
<db:out-param name="P_RESULT" type="NUMERIC"/>
</db:stored-procedure>
</batch:step>
Use MEL expressions instead of function:
#[server.dateTime.format('dd-MM-yy HH:mm:ss')]