Jan Maděra
Jan Maděra

Reputation: 546

How to use oracle sequence.nextval

I need to increment my id. I have to increment by using sequence in oracle database. When i use INSERT INTO XXX (seq_xxx.nextval, ....) i have error invalid column name.

EDIT: The problem was in capital letters SEQ_XXX.NEXTVAL is working fine.

Upvotes: 4

Views: 44965

Answers (1)

flyaround
flyaround

Reputation: 363

Insert Statement in Oracle:

insert into XXX (id, ...) values (seq_xxx.nextVal, ...)

Note: (id, ...) = table column names

Upvotes: 14

Related Questions