I am adding data to table. Table looks like this:
I am getting multiple data from my JSP page that should be entered uniquely each time.
Means in table prod_id
and sc_id
will remain same for this request.
Suppose I am getting 3 items then I have to use 3 insert query that will pass each item one by one.
I am using JSP and sevlet for this.
So my question is that is there any unique or other way to do so using single INSERT statement?
In mMSQL you can insert multiple rows in one insert command:
http://dev.mysql.com/doc/refman/5.5/en/insert.html
For example:
INSERT INTO tbl_name (a,b,c) VALUES(1,2,3),(4,5,6),(7,8,9);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With