Title, the result will be that the value of the parameter will not be the value you passed in, but the value of the field for each record.
The consequences of this are often severe. For example, to perform a delete operation, it can completely delete the entire table record.
This is my bloody price.
The dead pit is as follows, do not jump:
[SQL]View Plaincopy
- DELIMITER $$
- Use ' b10k ' $$
- DROP PROCEDURE IF EXISTS ' sp_delete_species ' $$
- CREATE definer= ' luth ' @ '% ' PROCEDURE ' sp_delete_species ' (
- in species_id INT,/* species id*/
- Out out_rows INT/* Number of affected rows * /
- )
- BEGIN
- DELETE from ' sample ' WHERE ' species_id ' = species_id;
- DELETE from ' filepath ' WHERE ' species_id ' = species_id;
- DELETE from ' species ' WHERE ' species_id ' = species_id;
- SET out_rows = Row_count ();
- end$$
- DELIMITER;
The parameter name of the MySQL stored procedure is not the same as the field name (Bloody cost)