Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2003
    Location
    Ottawa, ON, Canada
    Posts
    1

    Unanswered: CHECK error in innoDB table?

    Hello!
    I'm trying to create an innoDB table with a CHECK constraint:

    CREATE TABLE Advises (
    advisorSIN INT NOT NULL,
    adviseeSIN INT NOT NULL,
    PRIMARY KEY (advisorSIN, adviseeSIN),
    UNIQUE (adviseeSIN),
    FOREIGN KEY (advisorSIN) REFERENCES Employee (SIN) ON DELETE CASCADE,
    FOREIGN KEY (adviseeSIN) REFERENCES Employee (SIN) ON DELETE CASCADE,
    CHECK ((SELECT A.advisorSIN FROM Advises A WHERE A.adviseeSIN = advisorSIN) <> adviseeSIN) ) TYPE = InnoDB;

    But I can't seem to make one. The same table without CHECK works. Any suggestions? Thanks!

  2. #2
    Join Date
    Jan 2003
    Location
    Paris, France
    Posts
    320
    Because check are not allowed yet in mysql
    Olivier Miossec
    --
    http://www.lasso-developpeur.net/
    --

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •