sql - 删除 ORACLE 服务器中的保存点

标签 sql oracle

我了解 Oracle SQL 中的保存点 标识事务中的一个点,您稍后可以回滚

所以从技术上讲,如果我现在创建一个保存点并在数据库上执行 100 次操作,我可以回滚到这 100 次操作之前。

但如果现在我不想跟踪我的更改并删除保存点怎么办?

谢谢

最佳答案

正如 a_horse_with_no_name 评论的那样, Oracle 中没有删除保存点的语法。

当您COMMITROLLBACK 事务时,保存点会自动删除。

来自 the Oracle docs on Transaction Control :

The COMMIT statement ends the current transaction and makes all changes performed in the transaction permanent. COMMIT also erases all savepoints in the transaction and releases transaction locks.

The ROLLBACK statement reverses the work done in the current transaction; it causes all data changes since the last COMMIT or ROLLBACK to be discarded.

您可能还想修改代码以不创建保存点。

关于sql - 删除 ORACLE 服务器中的保存点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54688106/

相关文章:

php - 通过php生成报告

python - 从 cx_Oracle 内部使用 SQL*PLUS COPY?

sql - 将 TSQL 转换为 MS-Access SQL

mysql - 仅当特定列的值不存在时才获取行值

java - 从 Java 和 Ruby 访问 HSQL?

java - WSO2 API Manager : chpasswd. sh 在使用外部数据库时不起作用

sql - SQL 查询中函数调用的性能影响(关于上下文切换)

sql-server - SSIS 派生列日期格式化是否有一种不错的技术?

c# - 无法使用 Entity Framework 为 Oracle 创建数据库模型

mysql - 无法远程将 CSV 加载到 MySQL 中