ORA-02287: sequence number not allowed here问题的解决
当插入值需要从另外一张表中检索得到的时候,如下语法的sql语句已经不能完成该功能:
insert into my_table(id, name) values ((select seq_my_table.nextval from dual), ‘runto30′);
会报“ORA-02287: sequence number not allowed here”的错误,可以使用如下语句来完成:
insert into my_table(id, name) select seq_my_table.nextval, ' runto30 ' from dual;
或者是
insert into my_table(id, name) values( seq_my_table.nextval, ' runto30 ' )