Skip navigation links

MySQL Forums :: InnoDB :: ERROR: Error 1452: Cannot add or update a child row: a foreign key constraint fails


Advanced Search

ERROR: Error 1452: Cannot add or update a child row: a foreign key constraint fails
Posted by: Lee-Ann Lee-Ann ()
Date: April 19, 2010 10:12AM

Hi there

I hope someone can have a look at my 2 scripts and advise where I am going wrong. I am a new to mysql and would appreciate any help or advice.

Thye first script creates the database and inserts data into a table called web_cv. This executes with no errors. Here is script 1:



SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL';

DROP SCHEMA IF EXISTS `OHDBWEB` ;
CREATE SCHEMA IF NOT EXISTS `OHDBWEB` DEFAULT CHARACTER SET latin1 ;
USE `OHDBWEB`;

-- -----------------------------------------------------
-- Table `OHDBWEB`.`CUSTOMER`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `OHDBWEB`.`CUSTOMER` ;

CREATE TABLE IF NOT EXISTS `OHDBWEB`.`CUSTOMER` (
`CUSTOMER_ID` INT NOT NULL AUTO_INCREMENT ,
`FIRST_NAME` VARCHAR(45) NOT NULL ,
`LAST_NAME` VARCHAR(45) NOT NULL ,
`STREET_NUMBER` INT NOT NULL ,
`STREET_NAME` VARCHAR(60) NOT NULL ,
`CITY` VARCHAR(45) NOT NULL ,
`PROVENCE` VARCHAR(45) NOT NULL ,
`POSTAL_CODE` INT NOT NULL ,
`E_MAIL` VARCHAR(60) NOT NULL ,
`AREA_CODE` INT NOT NULL ,
`TELEPHONE` VARCHAR(20) NOT NULL ,
`PERSONAL_IDENTIFICATION` INT NOT NULL ,
PRIMARY KEY (`CUSTOMER_ID`) )
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `OHDBWEB`.`INVOICE`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `OHDBWEB`.`INVOICE` ;

CREATE TABLE IF NOT EXISTS `OHDBWEB`.`INVOICE` (
`INVOICE_ID` INT NOT NULL AUTO_INCREMENT ,
`CUSTOMER_ID` INT NOT NULL ,
`INVOICE_DATE` DATETIME NOT NULL ,
`/INVOICE_TOTAL` DECIMAL(6) NOT NULL ,
PRIMARY KEY (`INVOICE_ID`) ,
INDEX `fk_INVOICE_CUSTOMER1` (`CUSTOMER_ID` ASC) ,
CONSTRAINT `fk_INVOICE_CUSTOMER1`
FOREIGN KEY (`CUSTOMER_ID` )
REFERENCES `OHDBWEB`.`CUSTOMER` (`CUSTOMER_ID` )
ON DELETE NO ACTION
ON UPDATE CASCADE)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `OHDBWEB`.`CUSTOMER_PAYMENT`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `OHDBWEB`.`CUSTOMER_PAYMENT` ;

CREATE TABLE IF NOT EXISTS `OHDBWEB`.`CUSTOMER_PAYMENT` (
`CUSTOMER_PAYMENT_ID` INT NOT NULL AUTO_INCREMENT ,
`INVOICE_ID` INT NOT NULL ,
`PAYMENT_DATE` DATETIME NOT NULL ,
`PAYMENT_TYPE` VARCHAR(45) NOT NULL ,
`PAYMENT_AMOUNT` DECIMAL(6) NOT NULL ,
PRIMARY KEY (`CUSTOMER_PAYMENT_ID`) ,
INDEX `fk_CUSTOMER_PAYMENT_INVOICE1` (`INVOICE_ID` ASC) ,
CONSTRAINT `fk_CUSTOMER_PAYMENT_INVOICE1`
FOREIGN KEY (`INVOICE_ID` )
REFERENCES `OHDBWEB`.`INVOICE` (`INVOICE_ID` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `OHDBWEB`.`GREEN_CLUB`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `OHDBWEB`.`GREEN_CLUB` ;

CREATE TABLE IF NOT EXISTS `OHDBWEB`.`GREEN_CLUB` (
`GREEN_CLUB_ID` INT NOT NULL AUTO_INCREMENT ,
`CUSTOMER_CUSTOMER_ID` INT NOT NULL ,
`CUSTOMER_PAYMENT_ID` INT NOT NULL ,
`CLUB_POINTS` INT NOT NULL ,
`CUSTOMER_ID` INT NOT NULL ,
PRIMARY KEY (`GREEN_CLUB_ID`, `CUSTOMER_CUSTOMER_ID`) ,
INDEX `fk_GREEN_CLUB_CUSTOMER_PAYMENT1` (`CUSTOMER_PAYMENT_ID` ASC) ,
INDEX `fk_GREEN_CLUB_CUSTOMER1` (`CUSTOMER_CUSTOMER_ID` ASC) ,
CONSTRAINT `fk_GREEN_CLUB_CUSTOMER_PAYMENT1`
FOREIGN KEY (`CUSTOMER_PAYMENT_ID` )
REFERENCES `OHDBWEB`.`CUSTOMER_PAYMENT` (`CUSTOMER_PAYMENT_ID` )
ON DELETE NO ACTION
ON UPDATE CASCADE,
CONSTRAINT `fk_GREEN_CLUB_CUSTOMER1`
FOREIGN KEY (`CUSTOMER_CUSTOMER_ID` )
REFERENCES `OHDBWEB`.`CUSTOMER` (`CUSTOMER_ID` )
ON DELETE NO ACTION
ON UPDATE CASCADE)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `OHDBWEB`.`USERS`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `OHDBWEB`.`USERS` ;

CREATE TABLE IF NOT EXISTS `OHDBWEB`.`USERS` (
`USER_NAME` VARCHAR(15) NOT NULL ,
`CUSTOMER_CUSTOMER_ID` INT NOT NULL ,
`USER_PASS` VARCHAR(15) NOT NULL ,
`SECURITY_QUESTION` VARCHAR(45) NULL ,
`SECURITY_ANSWER` VARCHAR(45) NULL ,
`CUSTOMER_ID` INT NOT NULL ,
PRIMARY KEY (`USER_NAME`, `CUSTOMER_CUSTOMER_ID`) ,
INDEX `fk_USERS_CUSTOMER1` (`CUSTOMER_CUSTOMER_ID` ASC) ,
CONSTRAINT `fk_USERS_CUSTOMER1`
FOREIGN KEY (`CUSTOMER_CUSTOMER_ID` )
REFERENCES `OHDBWEB`.`CUSTOMER` (`CUSTOMER_ID` )
ON DELETE NO ACTION
ON UPDATE CASCADE)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `OHDBWEB`.`CUSTOMER_FEEDBACK`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `OHDBWEB`.`CUSTOMER_FEEDBACK` ;

CREATE TABLE IF NOT EXISTS `OHDBWEB`.`CUSTOMER_FEEDBACK` (
`CUSTOMER_FEEDBACK_ID` INT NOT NULL AUTO_INCREMENT ,
`CUSTOMER_ID` INT NOT NULL ,
`FEEDBACK` VARCHAR(100) NOT NULL ,
PRIMARY KEY (`CUSTOMER_FEEDBACK_ID`) ,
INDEX `fk_CUSTOMER_FEEDBACK_CUSTOMER1` (`CUSTOMER_ID` ASC) ,
CONSTRAINT `fk_CUSTOMER_FEEDBACK_CUSTOMER1`
FOREIGN KEY (`CUSTOMER_ID` )
REFERENCES `OHDBWEB`.`CUSTOMER` (`CUSTOMER_ID` )
ON DELETE NO ACTION
ON UPDATE CASCADE)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `OHDBWEB`.`WEB_CV`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `OHDBWEB`.`WEB_CV` ;

CREATE TABLE IF NOT EXISTS `OHDBWEB`.`WEB_CV` (
`WEB_CV_ID` INT NOT NULL AUTO_INCREMENT ,
`FIRST_NAME` VARCHAR(45) NOT NULL ,
`LAST_NAME` VARCHAR(45) NOT NULL ,
`AREA_CODE` INT NOT NULL ,
`TELEPHONE` VARCHAR(20) NOT NULL ,
`E_MAIL` VARCHAR(60) NOT NULL ,
`CV` BLOB NULL ,
PRIMARY KEY (`WEB_CV_ID`) )
ENGINE = InnoDB
AUTO_INCREMENT = 1
PACK_KEYS = DEFAULT;


-- -----------------------------------------------------
-- Table `OHDBWEB`.`VENUE`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `OHDBWEB`.`VENUE` ;

CREATE TABLE IF NOT EXISTS `OHDBWEB`.`VENUE` (
`VENUE_ID` INT NOT NULL AUTO_INCREMENT ,
`WEB_CV_ID` INT NOT NULL ,
`VENUE_NAME` VARCHAR(45) NOT NULL ,
`STREET_NUMBER` INT NOT NULL ,
`STREET_NAME` VARCHAR(45) NOT NULL ,
`CITY` VARCHAR(45) NOT NULL ,
`PROVENCE` VARCHAR(45) NOT NULL ,
`POSTAL_CODE` INT NOT NULL ,
`E_MAIL` VARCHAR(60) NOT NULL ,
`AREA_CODE` INT NOT NULL ,
`TELEPHONE` VARCHAR(20) NOT NULL ,
PRIMARY KEY (`VENUE_ID`) ,
INDEX `fk_VENUE_WEB_CV1` (`WEB_CV_ID` ASC) ,
CONSTRAINT `fk_VENUE_WEB_CV1`
FOREIGN KEY (`WEB_CV_ID` )
REFERENCES `OHDBWEB`.`WEB_CV` (`WEB_CV_ID` )
ON DELETE NO ACTION
ON UPDATE CASCADE)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `OHDBWEB`.`RESERVATIONS`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `OHDBWEB`.`RESERVATIONS` ;

CREATE TABLE IF NOT EXISTS `OHDBWEB`.`RESERVATIONS` (
`RESERVATIONS_ID` INT NOT NULL AUTO_INCREMENT ,
`VENUE_VENUE_ID` INT NOT NULL ,
`CUSTOMER_ID` INT NOT NULL ,
`RESERVATION_TYPE` VARCHAR(10) NOT NULL ,
`CHECK_IN_DATE` DATETIME NOT NULL ,
`CHECK_OUT_DATE` DATETIME NOT NULL ,
`NUMBER_OF_GUESTS` INT NOT NULL ,
`SPECIAL_REQUESTS` VARCHAR(100) NOT NULL ,
`VENUE_ID` VARCHAR(45) NOT NULL ,
PRIMARY KEY (`RESERVATIONS_ID`, `VENUE_VENUE_ID`) ,
INDEX `fk_RESERVATIONS_CUSTOMER1` (`CUSTOMER_ID` ASC) ,
INDEX `fk_RESERVATIONS_VENUE1` (`VENUE_VENUE_ID` ASC) ,
CONSTRAINT `fk_RESERVATIONS_CUSTOMER1`
FOREIGN KEY (`CUSTOMER_ID` )
REFERENCES `OHDBWEB`.`CUSTOMER` (`CUSTOMER_ID` )
ON DELETE NO ACTION
ON UPDATE CASCADE,
CONSTRAINT `fk_RESERVATIONS_VENUE1`
FOREIGN KEY (`VENUE_VENUE_ID` )
REFERENCES `OHDBWEB`.`VENUE` (`VENUE_ID` )
ON DELETE NO ACTION
ON UPDATE CASCADE)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `OHDBWEB`.`ROOMS`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `OHDBWEB`.`ROOMS` ;

CREATE TABLE IF NOT EXISTS `OHDBWEB`.`ROOMS` (
`ROOMS_ID` INT NOT NULL AUTO_INCREMENT ,
`VENUE_ID` INT NOT NULL ,
`ROOM_TYPE` VARCHAR(20) NOT NULL ,
PRIMARY KEY (`ROOMS_ID`) ,
INDEX `fk_ROOMS_VENUE1` (`VENUE_ID` ASC) ,
CONSTRAINT `fk_ROOMS_VENUE1`
FOREIGN KEY (`VENUE_ID` )
REFERENCES `OHDBWEB`.`VENUE` (`VENUE_ID` )
ON DELETE NO ACTION
ON UPDATE CASCADE)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `OHDBWEB`.`SERVICES`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `OHDBWEB`.`SERVICES` ;

CREATE TABLE IF NOT EXISTS `OHDBWEB`.`SERVICES` (
`SERVICES_ID` INT NOT NULL AUTO_INCREMENT ,
`VENUE_ID` INT NOT NULL ,
`DESCRIPTION` VARCHAR(45) NOT NULL ,
`RATE` DECIMAL(5) NOT NULL ,
PRIMARY KEY (`SERVICES_ID`) ,
INDEX `fk_SERVICES_VENUE1` (`VENUE_ID` ASC) ,
CONSTRAINT `fk_SERVICES_VENUE1`
FOREIGN KEY (`VENUE_ID` )
REFERENCES `OHDBWEB`.`VENUE` (`VENUE_ID` )
ON DELETE NO ACTION
ON UPDATE CASCADE)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `OHDBWEB`.`ROOM_RATE`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `OHDBWEB`.`ROOM_RATE` ;

CREATE TABLE IF NOT EXISTS `OHDBWEB`.`ROOM_RATE` (
`ROOM_RATE_ID` INT NOT NULL AUTO_INCREMENT ,
`ROOMS_ID` INT NOT NULL ,
`INTERNET_RATE` DECIMAL(5) NOT NULL ,
`WALK_IN_RATE` DECIMAL(5) NOT NULL ,
PRIMARY KEY (`ROOM_RATE_ID`) ,
INDEX `fk_ROOM_RATE_ROOMS1` (`ROOMS_ID` ASC) ,
CONSTRAINT `fk_ROOM_RATE_ROOMS1`
FOREIGN KEY (`ROOMS_ID` )
REFERENCES `OHDBWEB`.`ROOMS` (`ROOMS_ID` )
ON DELETE NO ACTION
ON UPDATE CASCADE)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `OHDBWEB`.`INVOICE_LINE`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `OHDBWEB`.`INVOICE_LINE` ;

CREATE TABLE IF NOT EXISTS `OHDBWEB`.`INVOICE_LINE` (
`INVOICE_LINE_ID` INT NOT NULL AUTO_INCREMENT ,
`ROOM_RATE_ID` INT NOT NULL ,
`INVOICE_ID` INT NOT NULL ,
`SERVICES_ID` INT NOT NULL ,
`LINE_UNIT` INT NOT NULL ,
`LINE_PRICE` DECIMAL(6) NOT NULL ,
PRIMARY KEY (`INVOICE_LINE_ID`, `ROOM_RATE_ID`, `INVOICE_ID`, `SERVICES_ID`) ,
INDEX `fk_INVOICE_LINE_ROOM_RATE1` (`ROOM_RATE_ID` ASC) ,
INDEX `fk_INVOICE_LINE_INVOICE1` (`INVOICE_ID` ASC) ,
INDEX `fk_INVOICE_LINE_SERVICES1` (`SERVICES_ID` ASC) ,
CONSTRAINT `fk_INVOICE_LINE_ROOM_RATE1`
FOREIGN KEY (`ROOM_RATE_ID` )
REFERENCES `OHDBWEB`.`ROOM_RATE` (`ROOM_RATE_ID` )
ON DELETE NO ACTION
ON UPDATE CASCADE,
CONSTRAINT `fk_INVOICE_LINE_INVOICE1`
FOREIGN KEY (`INVOICE_ID` )
REFERENCES `OHDBWEB`.`INVOICE` (`INVOICE_ID` )
ON DELETE NO ACTION
ON UPDATE CASCADE,
CONSTRAINT `fk_INVOICE_LINE_SERVICES1`
FOREIGN KEY (`SERVICES_ID` )
REFERENCES `OHDBWEB`.`SERVICES` (`SERVICES_ID` )
ON DELETE NO ACTION
ON UPDATE CASCADE)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `OHDBWEB`.`INVOICE_PAYMENT_HISTORY`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `OHDBWEB`.`INVOICE_PAYMENT_HISTORY` ;

CREATE TABLE IF NOT EXISTS `OHDBWEB`.`INVOICE_PAYMENT_HISTORY` (
`INVOICE_PAYMENT_HISTORY_ID` INT NOT NULL AUTO_INCREMENT ,
`CUSTOMER_PAYMENT_ID` INT NOT NULL ,
`INVOICE_ID` INT NOT NULL ,
`INVOICE_PAYMENT_DATE` DATETIME NOT NULL ,
PRIMARY KEY (`INVOICE_PAYMENT_HISTORY_ID`) ,
INDEX `fk_INVOICE_PAYMENT_HISTORY_CUSTOMER_PAYMENT1` (`CUSTOMER_PAYMENT_ID` ASC) ,
INDEX `fk_INVOICE_PAYMENT_HISTORY_INVOICE1` (`INVOICE_ID` ASC) ,
CONSTRAINT `fk_INVOICE_PAYMENT_HISTORY_CUSTOMER_PAYMENT1`
FOREIGN KEY (`CUSTOMER_PAYMENT_ID` )
REFERENCES `OHDBWEB`.`CUSTOMER_PAYMENT` (`CUSTOMER_PAYMENT_ID` )
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_INVOICE_PAYMENT_HISTORY_INVOICE1`
FOREIGN KEY (`INVOICE_ID` )
REFERENCES `OHDBWEB`.`INVOICE` (`INVOICE_ID` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `OHDBWEB`.`USER_ROLES`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `OHDBWEB`.`USER_ROLES` ;

CREATE TABLE IF NOT EXISTS `OHDBWEB`.`USER_ROLES` (
`USER_NAME` VARCHAR(15) NOT NULL ,
`ROLE_NAME` VARCHAR(15) NOT NULL ,
PRIMARY KEY (`USER_NAME`, `ROLE_NAME`) ,
INDEX `fk_USER_ROLES_USERS1` (`USER_NAME` ASC) ,
CONSTRAINT `fk_USER_ROLES_USERS1`
FOREIGN KEY (`USER_NAME` )
REFERENCES `OHDBWEB`.`USERS` (`USER_NAME` )
ON DELETE NO ACTION
ON UPDATE CASCADE)
ENGINE = InnoDB;


grant SELECT on TABLE `OHDBWEB`.`USERS` to tommy;
grant SELECT on TABLE `OHDBWEB`.`USER_ROLES` to tommy;

SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;

-- -----------------------------------------------------
-- Data for table `OHDBWEB`.`WEB_CV`
-- -----------------------------------------------------
SET AUTOCOMMIT=0;
USE `OHDBWEB`;
INSERT INTO `WEB_CV` (`WEB_CV_ID`, `FIRST_NAME`, `LAST_NAME`, `AREA_CODE`, `TELEPHONE`, `E_MAIL`, `CV`) VALUES (0, 'Andre', 'Swart', 2711, '4710258', 'andre@hotmail.com', NULL);
INSERT INTO `WEB_CV` (`WEB_CV_ID`, `FIRST_NAME`, `LAST_NAME`, `AREA_CODE`, `TELEPHONE`, `E_MAIL`, `CV`) VALUES (0, 'Lee-Ann', 'Hendrick', 2711, '5698745', 'leeann@webmail.co.za', NULL);
INSERT INTO `WEB_CV` (`WEB_CV_ID`, `FIRST_NAME`, `LAST_NAME`, `AREA_CODE`, `TELEPHONE`, `E_MAIL`, `CV`) VALUES (0, 'Jessy', 'Paado', 2721, '4563328', 'jpaddo@mweb.co.za', NULL);

COMMIT;






When I add data to the second table "Venue" using the insert function of the workbench and proceed to execute it I recieve this error:


Executing SQL script in server

ERROR: Error 1452: Cannot add or update a child row: a foreign key constraint fails (`ohdbweb`.`venue`, CONSTRAINT `fk_VENUE_WEB_CV1` FOREIGN KEY (`WEB_CV_ID`) REFERENCES `web_cv` (`WEB_CV_ID`) ON DELETE NO ACTION ON UPDATE CASCADE)



INSERT INTO `VENUE` (`VENUE_ID`, `WEB_CV_ID`, `VENUE_NAME`, `STREET_NUMBER`, `STREET_NAME`, `CITY`, `PROVENCE`, `POSTAL_CODE`, `E_MAIL`, `AREA_CODE`, `TELEPHONE`) VALUES (0, 0, 'OHannas Inn Gauteng', 1, 'Rose Street', 'Johannesburg', 'Gauteng', 1710, 'info@ohannasgp.co.za', 2711, '4720145')



ERROR: Error 1452: Cannot add or update a child row: a foreign key constraint fails (`ohdbweb`.`venue`, CONSTRAINT `fk_VENUE_WEB_CV1` FOREIGN KEY (`WEB_CV_ID`) REFERENCES `web_cv` (`WEB_CV_ID`) ON DELETE NO ACTION ON UPDATE CASCADE)



INSERT INTO `VENUE` (`VENUE_ID`, `WEB_CV_ID`, `VENUE_NAME`, `STREET_NUMBER`, `STREET_NAME`, `CITY`, `PROVENCE`, `POSTAL_CODE`, `E_MAIL`, `AREA_CODE`, `TELEPHONE`) VALUES (0, 0, 'OHannas Hotel and Conference Cape Town', 14, 'Strand Road', 'Cape Town', 'Cape', 8000, 'info@ohannasct.co.za', 2721, '8951477')



ERROR: Error 1452: Cannot add or update a child row: a foreign key constraint fails (`ohdbweb`.`venue`, CONSTRAINT `fk_VENUE_WEB_CV1` FOREIGN KEY (`WEB_CV_ID`) REFERENCES `web_cv` (`WEB_CV_ID`) ON DELETE NO ACTION ON UPDATE CASCADE)



INSERT INTO `VENUE` (`VENUE_ID`, `WEB_CV_ID`, `VENUE_NAME`, `STREET_NUMBER`, `STREET_NAME`, `CITY`, `PROVENCE`, `POSTAL_CODE`, `E_MAIL`, `AREA_CODE`, `TELEPHONE`) VALUES (0, 0, 'OHannas Hotel and Wellness Centre Ireland', 5, 'Wicklow Way', 'Bray', 'Co Wicklow', 2, 'info@ohannasire.co.za', 3532, '6542299')



SQL script execution finished: statements: 50 succeeded, 3 failed


If someone has the time and is able to have a look at this and advise where I am going wrong I would be very greatful.

Notes:
**I am using Innodb on all tables

**The relationships were placed using existing columns

**The database has no data in it and I am trying to populate the tables with data

Thanking you
Kind regards
Lee-Ann

Options: ReplyQuote


Subject Views Written By Posted
ERROR: Error 1452: Cannot add or update a child row: a foreign key constraint fails 6623 Lee-Ann Lee-Ann 04/19/2010 10:12AM
Re: ERROR: Error 1452: Cannot add or update a child row: a foreign key constraint fails 3324 Chad Bourque 04/19/2010 12:35PM
Re: ERROR: Error 1452: Cannot add or update a child row: a foreign key constraint fails 2468 Lee-Ann Lee-Ann 04/19/2010 11:30PM
Re: ERROR: Error 1452: Cannot add or update a child row: a foreign key constraint fails 2272 Lee-Ann Lee-Ann 04/20/2010 12:06AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.