Reputation: 11
03:19:51 INSERT INTO students VALUES (NULL,'Craig','Franklin','1970-03-15','M','2010-05-30',3.10,'Y',null,3) 0.000 sec
INSERT INTO students VALUES (NULL,'Craig','Franklin','1970-03-15','M','2010-05-30',3.10,'Y',null,3);
SELECT * FROM students;
INSERT INTO students VALUES (NULL,'Harriet','Smith','1982-04-15','F','2010-05-30',3.22, 'Y',null,1);
SELECT * FROM students;
INSERT INTO students VALUES (NULL,'George','David','1984-11-05','M','2010-10-01',0.00, 'Y',null,3);
SELECT * FROM students;
INSERT INTO students VALUES (NULL,'Ben','Jefferson','1976-09-25','M','2010-02-21',1.80, 'N','Student on temporary leave to pursue other opportunities but plans on returning in 1 year',3);
SELECT * FROM students;
I changed IsActive to a bit(1) but I am still receiving an error in MySQL. I am trying to get IsActive to allow me place either 'Y' or 'Yes', 'N' or 'No'. I am also trying to insert the above: FirstName, LastName,BirthDate, Gender, StartDate, null for students currently enrolled and statement of withdrawal for last student, 1-4 for year enrolled in school. I've tables for courses and advisors without errors an don't know what is causing error in this INSERT statement.
Do I need to change IsActive to VARCHAR(5)? this is the error I receive: 03:19:51 INSERT INTO students VALUES (NULL,'Craig','Franklin','1970-03-15','M','2010-05-30',3.10,'Y',null,3) Error Code: 1366. Incorrect integer value: 'Y' for column 'IsActive' at row 1 0.000 sec
I'm not sure how to correct this error.
Upvotes: 0
Views: 2905
Reputation: 1
isActive column expect integer value but you entered string value('Y'). Please try 1, 0, etc.
Upvotes: 0