Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是 sqlj 的新手,并尝试使用由序列生成的 id 插入数据。这是我当前的代码:
String pattern = ...; #sql {INSERT INTO my_table (id, pattern) VALUES (my_seq.nextVal(), :(pattern))};
但我不断收到 ORA-02287 错误。我需要做不同的事情吗?
不是 sqlJ 专家,但在 SQL 部分你应该使用 my_seq.nextVal,不带 ()
省略后面的括号nextval:
nextval
#sql {INSERT INTO my_table (id, pattern) VALUES (my_seq.nextval, :(pattern))};