07-20-2023, 02:33 PM
i created a sequence using the following query,
create sequence qname_id_seq start with 1 increment by 1 nocache;
Now when i try to create a table which uses the above sequence, it is throwing the following error,
Error report:
SQL Error: ORA-00907: missing right parenthesis
00907. 00000 - "missing right parenthesis"
I used the following query to create a table with sequence.nextval,
CREATE TABLE qname
(
qname_id integer NOT NULL default qname_id_seq.nextval PRIMARY KEY,
qname VARCHAR2(4000) NOT NULL -- CONSTRAINT qname_uk UNIQUE
);
create sequence qname_id_seq start with 1 increment by 1 nocache;
Now when i try to create a table which uses the above sequence, it is throwing the following error,
Error report:
SQL Error: ORA-00907: missing right parenthesis
00907. 00000 - "missing right parenthesis"
I used the following query to create a table with sequence.nextval,
CREATE TABLE qname
(
qname_id integer NOT NULL default qname_id_seq.nextval PRIMARY KEY,
qname VARCHAR2(4000) NOT NULL -- CONSTRAINT qname_uk UNIQUE
);