gpt4 book ai didi

sql - ORA-00904: : 无效标识符

转载 作者:行者123 更新时间:2023-12-04 22:04:39 27 4
gpt4 key购买 nike

我试图在 Oracle 中创建一个表并收到错误:ORA-00904: : invalid identifier
这是我的命令。我真的看不出有什么问题。请帮我找出错误。谢谢。

CREATE TABLE Sale (
CustomerId INT NOT NULL ,
BarCode INT NOT NULL ,
SalesId INT NOT NULL ,
Date DATE NULL ,
CheckOut TINYINT(1) NULL ,
PRIMARY KEY (CustomerId, BarCode, SalesId) ,
CONSTRAINT fk_Customer_has_Product_Customer
FOREIGN KEY (CustomerId )
REFERENCES Customer (CustomerId )
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT fk_Customer_has_Product_Product1
FOREIGN KEY (BarCode )
REFERENCES Product (BarCode )
ON DELETE NO ACTION
ON UPDATE NO ACTION);

最佳答案

Oracle 标识符的最大长度为 30 个字符。这些超过了,是 32 个字符长:

  • fk_Customer_has_Product_Customer
  • fk_Customer_has_Product_Product1

  • Schema Object Naming Rules

    关于sql - ORA-00904: : 无效标识符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4452671/

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