gpt4 book ai didi

sql - ORA-02267 : column type incompatible with referenced column type

转载 作者:行者123 更新时间:2023-12-02 04:35:19 28 4
gpt4 key购买 nike

这是我的 SQL 编码:

CREATE TABLE TICKET (
TICKET_NO NUMBER,
VENUE_NO VARCHAR(3),
TICKET_DATE DATE,
TICKET_PRICE NUMBER(8,2),
PRIMARY KEY (TICKET_NO),
CONSTRAINT TICKET_VENUE_NO_FK
FOREIGN KEY (VENUE_NO) REFERENCES VENUE
);

这是错误的说明:

Error starting at line 1 in command:
CREATE TABLE TICKET (
TICKET_NO NUMBER,
VENUE_NO VARCHAR(3),
TICKET_DATE DATE,
TICKET_PRICE NUMBER(8,2),
PRIMARY KEY (TICKET_NO),
CONSTRAINT TICKET_VENUE_NO_FK
FOREIGN KEY (VENUE_NO) REFERENCES VENUE)
Error at Command Line:8 Column:13
Error report:
SQL Error: ORA-02267: column type incompatible with referenced column type
02267. 00000 - "column type incompatible with referenced column type"
*Cause: The datatype of the referencing column is incompatible with the

我的编码有什么问题吗?

最佳答案

检查 VENUE 表中的 VENUE_NO 字段是否与此表中的类型相同,即 VARCHAR(3)。

关于sql - ORA-02267 : column type incompatible with referenced column type,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44153618/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com