Amysqlproblem. Helpme!

Source: Internet
Author: User
Whythesestatementsarewrong? Keys -- keys @ OLD_UNIQUE_CHECKS @ UNIQUE_CHECKS, UNIQUE_CHECKS0; SET @ OLD_FOREIGN_KEY_CHECKS @ FOREIGN_KEY_CHECKS, FOREIGN_KEY_C... mysqlsqlschema

Why these statements are wrong?
These statements are auto generated by mysql workbench

-- MySQL Workbench Forward Engineering

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, ALLOW_INVALID_DATES ';

-- Schema SysBaseData

-- Schema SysBaseData

CREATE SCHEMA IF NOT EXISTSSysBaseDataDefault character set utf8 COLLATE utf8_general_ci;
Show warnings;
USESysBaseData;

-- TableSysBaseData.Instruments

CREATE TABLE IF NOT EXISTSSysBaseData.Instruments(
InstrumentIDCHAR (32) not null,
ExchangeIDCHAR (12) not null,
InstrumentNameCHAR (24) NULL,
Primary key (InstrumentID,ExchangeID))
ENGINE = InnoDB;

Show warnings;

-- TableSysBaseData.OrdersGroups

CREATE TABLE IF NOT EXISTSSysBaseData.OrdersGroups(
OrderGroupInt not null,
OrderRefCHAR (16) not null,
TradingDayDate not null,
Primary key (OrderRef,TradingDay,OrderGroup))
ENGINE = InnoDB;

Show warnings;

-- TableSysBaseData.ErrorOrderRecords

CREATE TABLE IF NOT EXISTSSysBaseData.ErrorOrderRecords(
InstrumentIDCHAR (32) NULL,
ExchangeIDCHAR (12) NULL,
OrderPriceTypeChar null,
DirectionChar null,
LimitPriceCHAR (16) NULL,
VolumeTotalOriginalInt null,
ErrorMsgCHAR (255) NULL,
OrderGroupInt not null,
OrderRefCHAR (16) not null,
TradingDayDate not null,
Primary key (TradingDay,OrderRef,OrderGroup),
CONSTRAINTfk_ErrorOrderRecords_1
Foreign key (TradingDay,OrderRef,OrderGroup)
REFERENCESSysBaseData.OrdersGroups(TradingDay,OrderRef,OrderGroup)
ON DELETE NO ACTION
On update no action)
ENGINE = InnoDB;

Show warnings;

SET SQL _MODE = @ OLD_ SQL _MODE;
SET FOREIGN_KEY_CHECKS = @ OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS = @ OLD_UNIQUE_CHECKS;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.