Comments - Why is this create table statement failing?

5 years ago Venkat Venkataramanan

This table has a FK relationship with the following two tables:

CREATE TABLE meddra_version_lang ( meddra_version_no VARCHAR(6) NOT NULL, language_code VARCHAR(100) NOT NULL, release_date DATETIME NULL, imported_date DATETIME NOT NULL DEFAULT now(), update_user_id VARCHAR(100) NOT NULL, update_timestamp TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT xpkmeddra_version_lang PRIMARY KEY (meddra_version_no,language_code), CONSTRAINT R_47 FOREIGN KEY (meddra_version_no) REFERENCES meddra_version (meddra_version_no) )

and

CREATE TABLE pt ( meddra_version_no VARCHAR(6) NOT NULL, pt_id BIGINT NOT NULL, soc_id BIGINT NULL, who_art_cd VARCHAR(7) NULL, harts_id BIGINT NULL, costart_term_sym VARCHAR(21) NULL, icd9_cd VARCHAR(8) NULL, icd9_cm_cd VARCHAR(8) NULL, icd10_cd VARCHAR(8) NULL, j_arts_cd VARCHAR(6) NULL, update_user_id VARCHAR(100) NOT NULL, update_timestamp TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT xkppt PRIMARY KEY (meddra_version_no,pt_id), CONSTRAINT R_8 FOREIGN KEY (meddra_version_no) REFERENCES meddra_version (meddra_version_no), CONSTRAINT R_13 FOREIGN KEY (meddra_version_no, soc_id) REFERENCES soc (meddra_version_no, soc_id) )

Both these tables were created without any issue.

venki

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.