Unsupported Screen Size: The viewport size is too small for the theme to render properly.

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • in reply to: trouble with setting One to many relartion #15755
    dahuan60
    Member

    Okay, here it is. Thanks a lot!

    /*

    SQLyog v3.7

    Host – localhost : Database – fixed asset

    **************************************************************

    Server version 4.0.13-nt

    */

    SET FOREIGN_KEY_CHECKS=0;

    create database if not exists `fixed asset`;

    use `fixed asset`;

    /*

    Table structure for core

    */

    drop table if exists `core`;

    CREATE TABLE `core` (

    `TagID` varchar(6) NOT NULL default '',

    `AssetType` char(1) default NULL,

    `Categ` varchar(10) NOT NULL default '',

    `Description` varchar(20) default NULL,

    `Cost` decimal(8,0) default '0',

    `AcqDate` date default NULL,

    `Manufac` varchar(35) default NULL,

    `ModelNo` varchar(10) default NULL,

    `SerNo` varchar(20) default NULL,

    `WrantyExp` date default NULL,

    `CostrCr` varchar(4) default NULL,

    `Vender` varchar(35) default NULL,

    `ResponsibleName` varchar(40) default NULL,

    `Bldg` char(2) default NULL,

    `Wing` char(3) default NULL,

    `Room` varchar(4) default NULL,

    `SvcCtrt` char(1) default NULL,

    `ContNum` varchar(8) default NULL,

    PRIMARY KEY (`TagID`),

    KEY `ContNum` (`ContNum`)

    ) TYPE=InnoDB;

    /*

    Table structure for svcontract

    */

    drop table if exists `svcontract`;

    CREATE TABLE `svcontract` (

    `ContNum` varchar(8) NOT NULL default '',

    `SVCVender` varchar(35) default NULL,

    `BegDate` date default NULL,

    `EndDate` date default NULL,

    `ContName` varchar(40) default NULL,

    `PhoneNum` varchar(19) default NULL,

    `EMail` varchar(50) default NULL,

    PRIMARY KEY (`ContNum`)

    ) TYPE=InnoDB;

    SET FOREIGN_KEY_CHECKS=1;

    in reply to: trouble with setting One to many relartion #15753
    dahuan60
    Member

    No SQL have been to write to create table or set relationship. So, how I can attach this mysql database to you and get help. Also, I have a sql back up file but how to retrive it and show all tables in sqlyog???

    in reply to: Relationships #14510
    dahuan60
    Member

    CREATE TABLE `svcontract`

    `TagID` varchar(6) NOT NULL default '',

    `SVCVender` varchar(35) default NULL,

    `ContNum` varchar(8) default NULL,

    `BegDate` date default NULL,

    `EndDate` date default NULL,

    `ContName` varchar(40) default NULL,

    `PhoneNum` varchar(19) default NULL,

    `EMail` varchar(50) default NULL,

    PRIMARY KEY (`TagID`)

    ) TYPE=InnoDB

    and

    CREATE TABLE `core` (

    `TagID` varchar(6) NOT NULL default '',

    `AssetType` char(1) default NULL,

    `Categ` varchar(10) NOT NULL default '',

    `Description` varchar(20) default NULL,

    `Cost` decimal(6,0) default NULL,

    `AcqDate` time default NULL,

    `Manufac` varchar(35) default NULL,

    `ModelNo` varchar(10) default NULL,

    `SerNo` varchar(20) default NULL,

    `Vender` varchar(35) default NULL,

    `WrantyExp` time default NULL,

    `SvcCtrt` char(1) default NULL,

    `ResponsibleName` varchar(40) default NULL,

    `CostrCr` varchar(4) default NULL,

    `Bldg` char(2) default NULL,

    `Wing` char(3) default NULL,

    `Room` varchar(4) default NULL,

    PRIMARY KEY (`TagID`) Need create 1-1 relationship.

    in reply to: Relationships #14508
    dahuan60
    Member

    I have one to one relationship in DB. Why I can' get updated data in child table when I update date in main table? Also, when I add a new data in the main table. my child table doesn't add a new data.

    I got Error message : ErrorNo 1216 Cannot add or update row: a foreign key constraint fail.

    Please help!

Viewing 4 posts - 1 through 4 (of 4 total)