Good day everyone. Im new to SQL and just starting to learn, but I am getting an error which prevents me from continuing.
I am following a course guide and one of the starting examples was to create a sequence with the name myseq, it should start with the number 1, and increase by 1.
The sequence method nextval should return a numbertype.
So what I did was :
CREATE SEQUENCE myseq
START WITH 1
INCREMENT BY 1;
Which gave me this statement: Sequence MYSEQ created.
All good so far, but my next input gives me an error.
SELECT myseq.NEXTVAL FROM dual;
ORA-02287: sequence number not allowed here
https://docs.oracle.com/error-help/db/ora-02287/
ORA-02287. 00000 - "sequence number not allowed here"
*Cause: The specified sequence number (CURRVAL or NEXTVAL) is inappropriate
here in the statement.
*Action: Remove the sequence number.
Error at Line: 1 Column: 12

When watching my teacher do the solution he does exactly the same as I did, and it worked. Might have been something that changed in newer versions, he uses 19.2 and I use the current r28.1.
Best regards Robin