MySQL Forums
Forum List  »  Stored Procedures

Re: How to create Stored Procedure to INSERT multiple Rows in a table
Posted by: Hemant Mehta
Date: April 26, 2020 01:58PM

Hello Peter,
Apologies for not making requirement clear.
I will try to put requirement through a Use Case
I am getting a XML which can have multiple student records at once. It can be a XML with 3 student records at a time and next time I might get with 8 students.
Every block of Student in XML message will have additional attributes related to that student (for e.g. First Name, Last Name, DOB, RollNumber, Address).

Now I need to INSERT these records in a table STUDENT.
I was hesitant of looping through the number of records into the incoming XML and then creating connection and doing INSERT every time from Application.
So, was thinking if there could be a way if that can be handled in Stored Procedure and Array of records can be sent as parameter in SP.

Options: ReplyQuote




Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.