oraclesequencenextvalcurrval

Sequence in create table?


So I failed in exam with score 60% which needed 3% for pass, and I want to know about sequence in create table statement, in question given us that => in the database "exist" sequence for example SEQ_001 and used in for example=>

SQL>create table ( id number default seq_001.nextval ); or
    create table ( id number default seq_001.currval );

And in the topic of 1z0 071 written that =>

This exam was validated against 11g Release 2 version 11.2.0.1.0 and up to 19c

And I know that sequence is possible in create table from 12c but not in previous versions, so how I can know that which version is for this questions and how to check that the exist sequence is used with nextval, exists not means that it is used( I am about nextval after creating, if no currval can give error ). In this type questions I confused.


Solution

  • The following statement

    create table t23 ( id number default seq_001.nextval ); 
    

    succeeds on Oracle 18c (demo on db<>fiddle).

    but fails on Oracle 11gR2 with this error:

    ORA-00984: column not allowed here

    db<>fiddle uses XE editions, but I don't think that's the explanation. So it seems the exam was not "was validated against 11g Release 2 version 11.2.0.1.0" with full rigour.