Have an error while trying to create Oracle sequence

CREATE SEQUENCE HR.order_entry_id
             AS BIGINT START WITH 1 INCREMENT BY 1;

CREATE SEQUENCE HR.USER_PROFILE_SEQ
             AS BIGINT START WITH 1 INCREMENT BY 1

Error at line 1 ORA-00933: SQL command not properly ended

Is there an issue with this create statement?

有帮助吗?

解决方案

First, bigint is not a data type in Oracle. Second, the create sequence DDL statement does not accept an as <<data type>> clause.

CREATE SEQUENCE hr.order_entry_id
  START WITH 1
  INCREMENT BY 1 

Since you're not overriding the default start with or increment by, you can also just do

CREATE SEQUENCE hr.order_entry_id
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top