0
CREATE SEQUENCE HIBERNATE_SEQUENCE    
INCREMENT BY 1
START WITH 32137148  
MAXVALUE 1E28  
MINVALUE 1  
NOCYCLE  
CACHE 20  
NOORDER

can anyone take a look at this sql and tell me with you can find a problem next to NOCYCLE

I'm using PostgreSQL

1
  • 1
    What rdbms are you using? Commented Jul 25, 2014 at 17:22

2 Answers 2

2

You're using what seems to be Oracle syntax.

Since you're using PostgreSQL, you should double-check the syntax here: http://www.postgresql.org/docs/current/static/sql-createsequence.html

For example, NOCYCLE should be NO CYCLE, and NOORDER isn't supported at all.

It pays to read the documentation for the product you're using!

Sign up to request clarification or add additional context in comments.

1 Comment

oh thanks you're right, i'm using an oracle syntax as a template but i didn't know about the noorder.
0

As @Bill wrote, Oracle syntax doesn't work for Postgres. Best match in Postgres would be:

CREATE SEQUENCE hibernate_sequence
START 32137148  
CACHE 20

Which is the short for:

CREATE SEQUENCE hibernate_sequence
INCREMENT 1
MINVALUE 1
MAXVALUE 9223372036854775807  -- maximum possible
START 32137148  
CACHE 20
NO CYCLE
  • There is no NOORDER option.
  • MAXVALUE 1E28 .. invalid number format and outside the range of Postgres' bigint implementation.

Other options translated. All in the manual.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.