Quantcast
Channel: Active questions tagged debugging - Database Administrators Stack Exchange
Viewing all articles
Browse latest Browse all 49

MySQL gives Unknown column error when forward engineering database from diagram

$
0
0

I have a MySQL EER diagram the I forward engineer into a database. I also use the forward engineer feature to generate insert statements for data automatically. After entering about 120 rows of data I forward engineered the database only for it to give an error:

ERROR: Error 1054: Unknown column 'XX' in 'field list'SQL Code:        INSERT INTO `mydb`.`Person` (`Person_ID`, `SSN`, `FirstName`, `MiddleName`, `LastName`, `Gender`, `Race`, `MaritalStatus`, `Military`, `Note1`, `Note2`, `DOB`) VALUES (111, 'xxx-xx-xxxx', 'John', 'K', 'Smith', 'M', 'XX', 'XX', XX, 'Case_1', NULL, NULL) 

I don't understand what the problem is; I'm using the forward engineer feature so none of the column names can be misspelled. Is this just a bug?

I'm using MySQL Workbench 8.0.31 if that helps. I know it isn't the latest version, but I downgraded because I encountered crashes while querying in the new version.

Update: J.D helpfully pointed out that the field didn't have quotes and from there I was able to find the problem. The Military field was a TinyInt and therefore wasn't being given quotation marks, but the data being inserted was a string; hence the error.


Viewing all articles
Browse latest Browse all 49

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>