1
 CREATE SEQUENCE seq_mitarbeiterid
    INCREMENT BY 1
    START WITH 0
    MAX VALUE 9999
    NOCACHE
    NOCYCLE;

I can't see what's wrong with that statement or why I get that error message.

Thanks in advance.

3
  • Look to me that CREATE SEQUENCE is a command that works in almost any database engine other than the one you tagged Commented Mar 26, 2017 at 11:24
  • So what database are you actually using? Commented Mar 26, 2017 at 11:26
  • @asparagus . . . As far as I know, MySQL does not support sequences. Commented Mar 26, 2017 at 11:48

2 Answers 2

1

From the error, it looks like you are using Oracle. If so, there is a syntax error near MAX VALUE - which should be MAXVALUE.

CREATE SEQUENCE seq_mitarbeiterid
INCREMENT BY 1
START WITH 0
MAXVALUE 9999    -- Here
NOCACHE
NOCYCLE;
Sign up to request clarification or add additional context in comments.

Comments

0

As far as I know, MySQL does not support sequences. These are usually used to provide incremental ids for tables. If that is your purpose, then use auto_increment:

create table t (
    t_id int auto_increment primary key,
    . . .
);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.