Reputation:
Why does an error "ORA-01086: savepoint 'X' never established in this session or is invalid" appear on execution of this block?
begin
savepoint X;
execute immediate 'alter package ANY_EXISTING_PACKAGE compile';
rollback to X;
end;
Upvotes: 1
Views: 1557
Reputation: 23588
DDL does an implicit commit prior to running and either a rollback or commit afterwards. Therefore, your savepoint X in the above example is no longer applicable following the attempt to compile your package.
See: http://docs.oracle.com/cd/E11882_01/server.112/e40540/sqllangu.htm#sthref808
Upvotes: 3