Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8363447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:10:39+00:00 2026-06-09T12:10:39+00:00

This is the error message I get when I run the show DB innobd

  • 0

This is the error message I get when I run the show DB innobd status command . I am new to php and mysql and any help will be appreciated . Thank you in advance .

When I submit data into my database, the information goes into the asset tables but not the assert_details ?

LATEST FOREIGN KEY ERROR
------------------------
120811 22:40:43 Transaction:
TRANSACTION 1A4F, ACTIVE 0 sec inserting
mysql tables in use 1, locked 1
4 lock struct(s), heap size 1248, 2 row lock(s), undo log entries 2
MySQL thread id 73, OS thread handle 0x10ccc4000, query id 339 localhost root update
INSERT INTO asset_details (asset_type,make, model, serial_number, os,os_version,memory, hdd, processor,notes)
            Values( 'Monitor','Apple ','Mac Book Pro 17 inch ','65655453445545','Macintosh','Snow Lion ','5 gb ','1 TB','Intel i 9','This is Paskale New Mac book pro computer.')
Foreign key constraint fails for table `inventory1`.`asset_details`:
,
  CONSTRAINT `asset_tag` FOREIGN KEY (`asset_tag`) REFERENCES `asset` (`asset_tag`) ON DELETE CASCADE ON UPDATE CASCADE
Trying to add in child table, in index `asset_tag` tuple:
DATA TUPLE: 2 fields;
 0: len 4; hex 80000000; asc     ;;
 1: len 4; hex 80000001; asc     ;;

But in parent table `inventory1`.`asset`, in index `PRIMARY`,
the closest match we can find is record:
PHYSICAL RECORD: n_fields 8; compact format; info bits 0
 0: len 4; hex 80000007; asc     ;;
 1: len 6; hex 000000001a4f; asc      O;;
 2: len 7; hex c0000001d40110; asc        ;;
 3: SQL NULL;
 4: len 14; hex 4465636f6d6d697373696f6e6564; asc Decommissioned;;
 5: SQL NULL;
 6: len 7; hex 4d6f6e69746f72; asc Monitor;;
 7: SQL NULL;

This is the script to create the tables in my database .

This the script to create the the tables

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 `inventory1` ;
CREATE SCHEMA IF NOT EXISTS `inventory1` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci ;
USE `inventory1` ;

-- -----------------------------------------------------
-- Table `inventory1`.`department`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `inventory1`.`department` ;

CREATE  TABLE IF NOT EXISTS `inventory1`.`department` (
  `department_id` INT NOT NULL AUTO_INCREMENT ,
  `department_name` VARCHAR(45) NOT NULL ,
  `job_id` VARCHAR(45) NOT NULL ,
  PRIMARY KEY (`department_id`) )
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `inventory1`.`employee`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `inventory1`.`employee` ;

CREATE  TABLE IF NOT EXISTS `inventory1`.`employee` (
  `employee_id` INT NULL AUTO_INCREMENT ,
  `department_id` INT NOT NULL ,
  `fname` VARCHAR(45) NULL ,
  `lname` VARCHAR(45) NULL ,
  `email` VARCHAR(45) NULL ,
  `phone_number` VARCHAR(45) NULL ,
  `hire_date` VARCHAR(45) NULL ,
  `job_id` VARCHAR(45) NULL ,
  `manager_id` VARCHAR(45) NULL ,
  PRIMARY KEY (`employee_id`) ,
  INDEX `department_id` (`department_id` ASC) ,
  CONSTRAINT `department_id`
    FOREIGN KEY (`department_id` )
    REFERENCES `inventory1`.`department` (`department_id` )
    ON DELETE CASCADE
    ON UPDATE CASCADE)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `inventory1`.`invoice`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `inventory1`.`invoice` ;

CREATE  TABLE IF NOT EXISTS `inventory1`.`invoice` (
  `invoice_id` INT NOT NULL AUTO_INCREMENT ,
  `invoice_number` INT NULL ,
  `invoice_date` INT UNSIGNED NULL ,
  `purchase_price` INT UNSIGNED NULL ,
  `quantity` INT UNSIGNED NULL ,
  `order_date` INT UNSIGNED NULL ,
  `vender` INT UNSIGNED NULL ,
  `warranty_end` DATE NULL ,
  `notes` VARCHAR(255) NULL ,
  PRIMARY KEY (`invoice_id`) )
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `inventory1`.`asset`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `inventory1`.`asset` ;

CREATE  TABLE IF NOT EXISTS `inventory1`.`asset` (
  `asset_tag` INT NOT NULL ,
  `invoice_id` INT NULL ,
  `status` VARCHAR(25) NULL ,
  `cap_ex` VARCHAR(20) NULL ,
  `asset_type` VARCHAR(25) NULL ,
  `invoice_number` INT NULL ,
  PRIMARY KEY (`asset_tag`) ,
  CONSTRAINT `invoice_id`
    FOREIGN KEY (`invoice_id` )
    REFERENCES `inventory1`.`invoice` (`invoice_id` )
    ON DELETE CASCADE
    ON UPDATE CASCADE)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `inventory1`.`location`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `inventory1`.`location` ;

CREATE  TABLE IF NOT EXISTS `inventory1`.`location` (
  `location_id` INT NOT NULL AUTO_INCREMENT ,
  `location_name` VARCHAR(45) NULL ,
  `rack` INT NULL ,
  `row` INT NULL ,
  `unit` INT NULL ,
  PRIMARY KEY (`location_id`) )
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `inventory1`.`physical_asset`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `inventory1`.`physical_asset` ;

CREATE  TABLE IF NOT EXISTS `inventory1`.`physical_asset` (
  `physical_asset_id` INT NOT NULL AUTO_INCREMENT ,
  `location_id` INT NOT NULL ,
  `employee_id` INT NOT NULL ,
  `physical_asset_name` VARCHAR(45) NOT NULL ,
  PRIMARY KEY (`physical_asset_id`) ,
  INDEX `location_id` (`location_id` ASC) ,
  INDEX `employee_id` (`employee_id` ASC) ,
  CONSTRAINT `location_id`
    FOREIGN KEY (`location_id` )
    REFERENCES `inventory1`.`location` (`location_id` )
    ON DELETE CASCADE
    ON UPDATE CASCADE,
  CONSTRAINT `employee_id`
    FOREIGN KEY (`employee_id` )
    REFERENCES `inventory1`.`employee` (`employee_id` )
    ON DELETE CASCADE
    ON UPDATE CASCADE)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `inventory1`.`asset_details`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `inventory1`.`asset_details` ;

CREATE  TABLE IF NOT EXISTS `inventory1`.`asset_details` (
  `asset_id` INT NULL AUTO_INCREMENT ,
  `asset_tag` INT NOT NULL ,
  `physical_asset_id` INT NULL ,
  `asset_type` VARCHAR(45) NULL ,
  `manufacturer` VARCHAR(45) NULL ,
  `os` VARCHAR(45) NULL ,
  `os_version` VARCHAR(45) NULL ,
  `make` VARCHAR(45) NULL ,
  `model` VARCHAR(45) NULL ,
  `serial_number` VARCHAR(45) NULL ,
  `processor` VARCHAR(45) NULL ,
  `ram` VARCHAR(45) NULL ,
  `memory` VARCHAR(45) NULL ,
  `hdd` VARCHAR(45) NULL ,
  `host_name` VARCHAR(45) NULL ,
  `notes` VARCHAR(250) NULL ,
  PRIMARY KEY (`asset_id`) ,
  INDEX `physical_asset_id` (`physical_asset_id` ASC) ,
  INDEX `asset_tag` (`asset_tag` ASC) ,
  CONSTRAINT `physical_asset_id`
    FOREIGN KEY (`physical_asset_id` )
    REFERENCES `inventory1`.`physical_asset` (`physical_asset_id` )
    ON DELETE CASCADE
    ON UPDATE CASCADE,
  CONSTRAINT `asset_tag`
    FOREIGN KEY (`asset_tag` )
    REFERENCES `inventory1`.`asset` (`asset_tag` )
    ON DELETE CASCADE
    ON UPDATE CASCADE)
ENGINE = InnoDB;



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


    LATEST FOREIGN KEY ERROR
    ------------------------
    120811 22:40:43 Transaction:
    TRANSACTION 1A4F, ACTIVE 0 sec inserting
    mysql tables in use 1, locked 1
    4 lock struct(s), heap size 1248, 2 row lock(s), undo log entries 2
    MySQL thread id 73, OS thread handle 0x10ccc4000, query id 339 localhost root update
    INSERT INTO asset_details (asset_type,make, model, serial_number, os,os_version,memory, hdd, processor,notes)
                Values( 'Monitor','Apple ','Mac Book Pro 17 inch ','65655453445545','Macintosh','Snow Lion ','5 gb ','1 TB','Intel i 9','This is Paskale New Mac book pro computer.')
    Foreign key constraint fails for table `inventory1`.`asset_details`:
    ,
      CONSTRAINT `asset_tag` FOREIGN KEY (`asset_tag`) REFERENCES `asset` (`asset_tag`) ON DELETE CASCADE ON UPDATE CASCADE
    Trying to add in child table, in index `asset_tag` tuple:
    DATA TUPLE: 2 fields;
     0: len 4; hex 80000000; asc     ;;
     1: len 4; hex 80000001; asc     ;;

    But in parent table `inventory1`.`asset`, in index `PRIMARY`,
    the closest match we can find is record:
    PHYSICAL RECORD: n_fields 8; compact format; info bits 0
     0: len 4; hex 80000007; asc     ;;
     1: len 6; hex 000000001a4f; asc      O;;
     2: len 7; hex c0000001d40110; asc        ;;
     3: SQL NULL;
     4: len 14; hex 4465636f6d6d697373696f6e6564; asc Decommissioned;;
     5: SQL NULL;
     6: len 7; hex 4d6f6e69746f72; asc Monitor;;
     7: SQL NULL;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T12:10:40+00:00Added an answer on June 9, 2026 at 12:10 pm

    EDIT :sorry I had misread

    What happens is your try to put a line in a table that has foreign keys to other table but does not specify the foreign key id.

    You have to set the values of the foreign key ( and have those key existing on the other tables) before inserting into the asset_details table.

    So your insert

     INSERT INTO asset_details (asset_type,make, model, serial_number, os,os_version,memory, hdd, processor,notes)
            Values( 'Monitor','Apple ','Mac Book Pro 17 inch ','65655453445545','Macintosh','Snow Lion ','5 gb ','1 TB','Intel i 9','This is Paskale New Mac book pro computer.')
    

    should also include the physical_asset_id

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

if i run this, i get the sending messages but received message doesn't show
Why do I get this error message with this code? Use of undeclared identifier
I get this error message in LogCat: 06-25 15:17:34.495: E/AndroidRuntime(5891): java.lang.RuntimeException: Unable to start
I get this error message pageContext cannot be resolved but I have no variable
I get this error message in Eclipse: Access restriction: The type DirectoryWalker is not
I get this error message from a Ghostscript call: Error: /syntaxerror in -file- Operand
I get this error in my app { error: { message: Missing client_id parameter.,
I Have this error message : Possible unitended reference comparison; to get a value
I'm using websphere and Java EE and get this error message: Exception reading propertiesfile
When invoking a query on the data service I get this error message inside

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.