Click here to Skip to main content
14,735,364 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Error Code: 1366. Incorrect integer value: 'null' for column 'HomeTeamScore' at row 1


I am using MySQL Workbench 8.0

this is my code:

INSERT INTO season
(Season,PlayDate,HomeTeam,HomeTeamScore,AwayTeam,AwayTeamScore)
VALUES
('1','2020-07-12','1011','null','1017','null');

What I have tried:

I when I changed 'NULL' to '0' it works but I want it to say 'NULL' not 0.
Posted
Updated 18-Nov-20 20:38pm

1 solution

Try like this:
INSERT INTO season
(Season,PlayDate,HomeTeam,HomeTeamScore,AwayTeam,AwayTeamScore)
VALUES
('1','2020-07-12','1011',NULL,'1017',NULL);

Your table must allow null values on these fields.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900