Hi,
Can anyone please give me the syntax for using a sequence in the values clause of an insert statement :
e.g
insert into table1(id)
values (select seq.nextval from sys.dual)
the above is not correct syntax.
Thanks
Suresh
Printable View
Hi,
Can anyone please give me the syntax for using a sequence in the values clause of an insert statement :
e.g
insert into table1(id)
values (select seq.nextval from sys.dual)
the above is not correct syntax.
Thanks
Suresh
Try:
insert into EMP values (emp_seq.nextval, ....);
commit;
I have read on this board that selecting the next sequence value from dual can leave open cursors.
Good luck.
Actually, try:
insert into table1(id)
select seq.nextval from sys.dual;
- Chris
Thanks guys,
Both solutions worked.