0

私は次のクエリを持っています-

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を初めて使用し、開始トランザクションタイプのステートメントを取得しませんでしたが、commitは存在します。

このエラーを解決するにはどうすればよいですか?

解像度

私はフォローしました-

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 ;

私のコンテキストでは正常に機能しています。

4

1 に答える 1

0
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 ;
于 2013-02-12T05:56:01.493 に答える