oracle apex ora-00905和ora-06512

wz1wpwve  于 2021-07-26  发布在  Java
关注(0)|答案(1)|浏览(390)

我有以下由mysql工作台生成的sql语句。当我在oracleapex上运行它时,我得到了这些错误。有人能帮忙找出问题吗?

ORA-00905: missing keyword
ORA-06512: at "SYS.WWV_DBMS_SQL_APEX_190200", line 592
ORA-06512: at "SYS.DBMS_SYS_SQL", line 1658
ORA-06512: at "SYS.WWV_DBMS_SQL_APEX_190200", line 578
ORA-06512: at "APEX_190200.WWV_FLOW_DYNAMIC_EXEC", line 2057

CREATE TABLE Stores (
  Store_ID INT NOT NULL
  CONSTRAINT Store_ID PRIMARY KEY,
  Tipo VARCHAR(45) NOT NULL,
  Name VARCHAR(45) NOT NULL,
  FinancesOfficer_ID INT NOT NULL,
    CONSTRAINT fk_Stores_Finances_Officers
    FOREIGN KEY (FinancesOfficer_ID)
    REFERENCES Finances_Officers (FinancesOfficer_ID)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION,
  Owner_ID INT NOT NULL,
  CONSTRAINT fk_Stores_Store_Owners
    FOREIGN KEY (Owner_ID)
    REFERENCES Store_Owners (Owner_ID)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION);
zed5wv10

zed5wv101#

CREATE TABLE 声明如下:;我创建了两个虚拟主表,以便外键约束可以引用。

SQL> create table finances_officers (financesofficer_id int primary key);

Table created.

SQL> create table store_owners (owner_id int primary key);

Table created.

SQL>
SQL> create table stores
  2    (store_id            int,
  3     tipo                varchar2(45) not null,
  4     name                varchar2(45) not null,
  5     financesOfficer_id  int,
  6     owner_id            int,
  7     --
  8     constraint pk_sto primary key (store_id),
  9     --
 10     constraint fk_sto_finoff foreign key (financesofficer_id)
 11       references finances_officers (financesofficer_id),
 12    --
 13    constraint fk_sto_own foreign key (owner_id)
 14      references store_owners (owner_id)
 15    );

Table created.

SQL>

相关问题