Adding multiple rows to a Custom Data Table

Hello!

 

I'm currently trying to post a request with multiple rows to the Tessitura API and store the rows in table, I've registered in the TR_DATASERVICE_TABLES. The data is in the form of XML and the request is something like:

<root>

                             <row>

                                                          <id></id>

                                                          <customer_id></customer_id>

                                                          <event></event>

                             </row>

                             <row>

                                                          <id></id>

                                                          <customer_id></customer_id>

                                                          <event></event>

                             </row>

</root>

The endpoint is something like Custom/SaveActivityToTable. I’m able to only save the first row, but I need to multiple/bulk upload rows. I’ve also tried to create a Stored Procedure, which fetches the XML request.

INSERT INTO dbo.LT_MaillingLetterEvents (id,customer_no,event)

        SELECT

            XCol.value('(id)[1]', 'int'),

            XCol.value('(customer_no)[1]', 'int'),

            XCol.value('(event)[1]', 'varchar(120)')

        FROM

            @Input.nodes('/root/row') AS XTbl(XCol)

 

Which I try to call with Custom/Execute/SaveActivityStoredProcedure but I get the following error.

{

    "Message": "An error has occurred."

}

 

 

Do you have any suggestions on how to get the stored procedure to work or how I save multiple rows directly into the table?

Parents Reply Children