Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2009

    Unanswered: order of tables in DDL statement

    Am I correct that a parent table must precede a child table (in a DDL statement) or get a errno150?

    That's my conclusion after several rounds of isolate and substitute.

    BTW -- I had no problems (no errno 150) with a child table preceding a parent when building MyISAM tables. Is that because ref. integrity isn't forced with the MyISAM engine, or because something else was different?
    In theory, there is no difference between theory and practice. In practice there is.
    Disputed Origins

    Ninety-three percent of all statistics are made-up on the spot.
    Ancient proverb.

  2. #2
    Join Date
    Apr 2002
    Toronto, Canada
    you understand the situation perfectly

    a foreign key cannot reference a primary/unique key if that key has not yet been defined | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Mar 2004
    and to answer your other question, since myisam tables don't enforce referential integrity you won't run into the same problem with them that you do with innodb ones.

Posting Permissions

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