是否可以在Teradata中删除未命名的参照完整性约束? 例如:
父表:
CREATE SET TABLE MIGRATION_TOOL.UNIT_TEST_EXISTING_TABLE_DEPENDENCY_PARENT,
NO FALLBACK,
NO BEFORE JOURNAL,
NO AFTER JOURNAL,
CHECKSUM = DEFAULT,
DEFAULT MERGEBLOCKRATIO (
ID INTEGER,
NAME VARCHAR(50) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL,
DESCRIPTION VARCHAR(50) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL,
CREATION_DATE TIMESTAMP(6) DEFAULT CURRENT_TIMESTAMP(6),
LAST_UPDATE TIMESTAMP(6) DEFAULT CURRENT_TIMESTAMP(6)
)
UNIQUE PRIMARY INDEX UPI ( ID );
子表:
CREATE SET TABLE MIGRATION_TOOL.UNIT_TEST_EXISTING_TABLE_DEPENDENCY_CHILD,
NO FALLBACK,
NO BEFORE JOURNAL,
NO AFTER JOURNAL,
CHECKSUM = DEFAULT,
DEFAULT MERGEBLOCKRATIO (
ID INTEGER,
NAME VARCHAR(50) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL,
DESCRIPTION VARCHAR(50) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL,
CREATION_DATE TIMESTAMP(6) DEFAULT CURRENT_TIMESTAMP(6),
LAST_UPDATE TIMESTAMP(6) DEFAULT CURRENT_TIMESTAMP(6),
PARENT_ID INTEGER,
FOREIGN KEY ( PARENT_ID ) REFERENCES WITH NO CHECK OPTION MIGRATION_TOOL.UNIT_TEST_EXISTING_TABLE_DEPENDENCY_PARENT ( ID )
)
UNIQUE PRIMARY INDEX UPI ( ID );
如何删除外键/软参考完整性规则?
答案 0 :(得分:0)
好的,我发现了......
ALTER TABLE MIGRATION_TOOL.UNIT_TEST_EXISTING_TABLE_DEPENDENCY_CHILD
DROP FOREIGN KEY (PARENT_ID) REFERENCES
MIGRATION_TOOL.UNIT_TEST_EXISTING_TABLE_DEPENDENCY_PARENT(ID);