我有以下查询 -
SAVEPOINT A ON ROLLBACK RETAIN CURSORS;
select max(id) from testdb.table1;
ROLLBACK TO SAVEPOINT A;
commit
我收到以下错误
ROLLBACK TO SAVEPOINT A
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0880N SAVEPOINT "A" does not exist or is invalid in this context.
SQLSTATE=3B001
我是 DB2 新手,我没有得到任何启动事务类型语句,但是存在提交。
如何解决此错误?
解析度
我得到了关注-
update command options using c OFF;
SAVEPOINT A ON ROLLBACK RETAIN CURSORS;
select max(id) from testdb.table1;
ROLLBACK TO SAVEPOINT A;
commit;
update command options using c ON ;
它在我的上下文中运行良好。