我尝试使用execute block
将两个值插入到我的数据库中并返回插入id。
execute block returns (id integer)
as begin
insert into test (name) values ('test1') returning id into :id;
suspend;
insert into test (name) values ('test2') returning id into :id;
suspend;
end;
如果我不调用fetch|fetchAll
方法,则插入不会保留在数据库中。
查询执行多次读取结果集后,我无法调用fetchAll
。但是如果我在那里调用,插入是持久的,我可以获得返回值。