I have the following stored procedure, when I execute it, I specify the Id (By the way, my Id is PRIMARY KEY and AUTOINCREMENT) that I want to update and it executes correctly, when I check the table, all the records have been updated.
DELIMITER $$
DROP PROCEDURE IF EXISTS `calificaciones`.`SP_UPDATE_REGISTROS` $$
CREATE PROCEDURE `calificaciones`.`SP_UPDATE_REGISTROS`
(IN ID INT(11),
IN CAL LONGTEXT,
IN UNI LONGTEXT,
IN NC VARCHAR(10),
IN MAT LONGTEXT,
IN TER LONGTEXT,
IN PER INT(11),
IN COM TEXT,
IN CIC INT(11))
BEGIN
UPDATE calif_prueba SET
Calificacion=CAL,Unidad=UNI,N_Control=NC,
Materia=MAT,Termino=TER,Periodo=PER,Comentario=COM,año=CIC
WHERE Id=ID;
END $$
DELIMITER ;
If you update them all, it is because the WHERE condition is always true; test:
You can also change the ID name to IdItem for example and it would be:
The issue is that in no case use the same name. Updated would be like this: