After creating trigger :
DELIMITER #
CREATE TRIGGER BACKUP_PRODUTO_INS
AFTER INSERT ON PRODUTO
FOR EACH ROW
BEGIN
INSERT INTO BACKUP.BKP_PRODUTO VALUES(NULL, NEW.IDPRODUTO, NEW.NOME, NEW.VALOR, 'I');
END
#
DELIMITER ;
DESC of the PRODUTO
table:
+-----------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------+-------------+------+-----+---------+----------------+
| IDPRODUTO | int(11) | NO | PRI | NULL | auto_increment |
| NOME | varchar(30) | YES | | NULL | |
| VALOR | float(10,2) | YES | | NULLL | |
+-----------+-------------+------+-----+---------+----------------+
DESC of the BKP_PRODUTO
table:
+-----------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------+-------------+------+-----+---------+----------------+
| IDBKP | int(11) | NO | PRI | NULL | auto_increment |
| IDPRODUTO | int(11) | YES | | NULL | |
| NOME | varchar(30) | YES | | NULL | |
| VALOR | float(10,2) | YES | | NULL | |
| EVENTO | char(1) | YES | | NULL | |
+-----------+-------------+------+-----+---------+----------------+
When executing the following statement :
INSERT INTO PRODUTO VALUES(NULL, "LIVRO TESTE", 100.00);
The following error is generated in MySQL 5.7:
Column count doesn't match value count at row 1
I can not identify the error, since the values entered correspond to those stipulated in both tables. Could someone help me identify the problem?