I can't figure out this error:
Cannot add or update a child row: a foreign key constraint fails (
freight.rates_detail, CONSTRAINTrates_detail_ibfk_2FOREIGN KEY (component_id) REFERENCEScomputation(id) ON UPDATE CASCADE)
Here's what I'm trying to do(from the log):
INSERT INTO freight.rates_detail(rate_id,component_id,uom,rate,inc_or) values(0821,01,00,011.00,'Y')
I repeatedly looked and looked and reviewed the values of id in table computation and the value in that case: 01 exists.
What's the problem with this?
component_idcolumn?intwith length: 11intdoes not have "a length". The 11 is only a hint for a client application to be used when displaying the data. It does not limit the possible values in any way. You can store the same values in anint(1)and anint(11)