我想一次在mule数据库连接器中插入多行。任何人都可以请帮助我吗?如何在mule数据库连接器中插入多行?
我可以成功地将下面的消息作为发布请求插入到mule流中。
{
"patient_todo_id" : "2",
"comment_date" : "2017-09-20 14:41:16",
"comment_text" : "send me the steps to check the Pulse rate"
}
如何将下面的邮件消息插入到骡流中的数据库中?
[{
"patient_todo_id" : "2",
"comment_date" : "2017-09-20 14:41:16",
"comment_text" : "send me the steps to check the Pulse rate"
},
{
"patient_todo_id" : "2",
"comment_date" : "2017-09-20 14:41:16",
"comment_text" : "send me the steps to check the Pulse rate"
}]
请找到下面的mule流配置文件,它已被配置为一次插入一行。
<flow name="carrotcube-patient-todo-commentFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="${http.path.mrs.todo.comment}" doc:name="HTTP"/>
<set-variable variableName="variable" value="#[payload]" mimeType="application/json" doc:name="Variable"/>
<json:json-to-object-transformer returnClass="java.lang.Object" doc:name="JSON to Object"/>
<logger message="#[payload.comment_text]" level="INFO" doc:name="Logger"/>
<db:insert config-ref="MySQL_Configuration" doc:name="Database">
<db:parameterized-query><![CDATA[insert into patient_todo_detail(patient_todo_id,comment_date,comment_text) values (#[payload.patient_todo_id],#[payload.comment_date],#[payload.comment_text])]]></db:parameterized-query>
</db:insert>
</flow>
将尝试这一做法,并让你知道 –
现在我能够以连续的方式发布的记录,但我没能得到我插入记录插入状态(计数)。 –
我现在需要尝试一下。我相信将rowcount作为存储过程的输出参数返回并将其设置为输出有效负载应该可以工作。 –