MySQL insert with stored procedure
By Peter
Stored procedures can be used to insert new values for more than one table. This could be handy if the data is stored in few tables as well as restricting the inputs coming from the application layer.
The following example will show how to create a stored procedure for insert values in MySQL database. This can give the general idea of how to create a stored procedure which contains even some calculation made ‘on the fly’. After the procedure is created the separately issued insert statements can be replaced with a single line statement.
If you want to check the script just simply fire MySQL use a test database and copy and paste