Estoy intentando crear un sp para insertar datos en una tabla, pero me arroja el siguiente error:
"Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT INTO cliente ( Id_Cliente, Nombre, DNI, telefono, Direccion ) VALUES ( N_' at line 8"
Este es el DDL de la tabla:
CREATE TABLE `cliente` (
`Id_Cliente` int NOT NULL AUTO_INCREMENT,
`Nombre` varchar(40) NOT NULL,
`DNI` int NOT NULL,
`telefono` varchar(25) NOT NULL,
`Direccion` varchar(60) NOT NULL,
PRIMARY KEY (`Id_Cliente`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
Este es el código en el que me sale error, en la línea del INSERT INTO
:
DELIMITER //
USE NEGOCIO//
CREATE PROCEDURE SP_ELIMINACION_DATO (
IN N_Id_Cliente int,
IN N_Nombre VARCHAR (50),
IN N_DNI INT,
IN N_TELEFONO VARCHAR (50),
IN N_DIRECCION VARCHAR (60),
BEGIN
INSERT INTO cliente (
Id_Cliente,
Nombre,
DNI,
telefono,
Direccion
)
VALUES (
N_Id_Cliente,
N_Nombre,
N_DNI,
N_TELEFONO,
N_DIRECCION
)
END//
DELIMITER ;