Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2013
    Posts
    5

    Unanswered: problem in creating table - error 150

    Dears,

    Actually I was used this sql script to create the table scheme on mysql 5.0.24, and it was just working fine, the problem is when i tried same script on mysql 5.5.16 i get below error message:

    general error message from server: "can't create table 'amdb.am_wta_methodtree' (errno: 150)"
    Here it is sql script:

    Code:
    create table AM_WTA_MethodInstance(
    "ID" BIGINT NOT NULL,
    "TRANSACTIONID" BIGINT NOT NULL,
    "INVOCATIONTIME" BIGINT NOT NULL,
    "METHODIDENTIFIERID" BIGINT NOT NULL,
    "THREADID" VARCHAR(255) NOT NULL,
    "INCLUSIVETIME" BIGINT NOT NULL DEFAULT 0,
    "EXCLUSIVETIME" BIGINT NOT NULL DEFAULT 0,
    "STATUS" INTEGER(1) NOT NULL DEFAULT 0,
    "EXCEPTIONMESSAGE" TEXT,
    PRIMARY KEY ("ID"),
    FOREIGN KEY(METHODIDENTIFIERID) REFERENCES AM_WTA_MethodIdentifier(ID),
    FOREIGN KEY(TRANSACTIONID) REFERENCES AM_WTA_Transaction(TRANSACTIONID) ON DELETE CASCADE)
    
    create table AM_WTA_MethodTree(
    "PARENTID" BIGINT NOT NULL,
    "CHILDID" BIGINT NOT NULL,
    "INVOCATIONTIME" BIGINT NOT NULL,
    PRIMARY KEY ("PARENTID","CHILDID"),
    FOREIGN KEY(PARENTID,CHILDID) REFERENCES AM_WTA_MethodInstance(ID,ID) ON DELETE CASCADE)

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    the primary key definition in methodinstance is a big integer
    you are trying to declare a foreign key in methodtree that references methdoinstance but supplying two big integer columns

    what I suspect you are trying to do is actually create two foreign keys, one for parent one for child both referenceing the same key in methidinstance
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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