I am using Anypoint Studio 7.3 and Mule 4.1.
I am using the database bulk insert connector and I would like to pass in multiple input parameters into the SQL insert.
I have added multiple input parameters using the following syntax
{payload: payload, tableName: vars.tblName, username: vars.username}
but I get the error below and also not sure how I should reference the values in the payload is is still :Code or payload.Code:
Cannot coerce Object ({payload: [{Code: "1",Name: "test1",Co...) to Array
The configuration I am using is:
<db:bulk-insert doc:name="Bulk Insert" doc:id="36328b21-ffd9-485e-8afa-34b6cb742956" config-ref="db-config">
<db:bulk-input-parameters ><![CDATA[#[{payload: payload, tableName: vars.tblName, Username: vars.username}]]]></db:bulk-input-parameters>
<db:sql >#["INSERT INTO :tableName
(
:tableName,
Code,
Name,
Comments
User
)
VALUES
(
NEWID(),
:Code,
:Name,
:Comments,
:username
)"]</db:sql>
</db:bulk-insert>
Thanks for any help