我有以下查询-
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 ;
在我看来,它运行良好。
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 ;