ORACLE——表

发布于 2024-08-15 08:58:00 字数 53 浏览 3 评论 0原文

在 SQL ORACLE 中输入代码创建新表后,如果我要注销 SQL 会话,更改会被保存吗?

After entering code to create a new table in SQL ORACLE, would the changes be saved if I was to log out of the SQL Session?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

久隐师 2024-08-22 08:58:00

是的,您的表定义已保存; Oracle DDL 具有隐式事务*。其他数据库,例如 PostrgreSQL,确实有事务性 DDL,但对于 Oracle,它是自动的,所以要小心。

* Oracle 事务管理:如果当前事务包含任何DML语句,Oracle首先提交该事务,然后运行 ​​DDL 语句并将其作为新的单语句事务提交。

Yes, your table definitions are saved; Oracle DDL has an implicit transaction*. Other databases, such as PostrgreSQL, do have transactional DDL, but with Oracle, it is automatic, so be careful.

* Oracle Transaction Management: If the current transaction contains any DML statements, Oracle first commits the transaction, and then runs and commits the DDL statement as a new, single statement transaction.

长梦不多时 2024-08-22 08:58:00

正确的答案是Oracle DDL 使用隐式事务——事务没有机会返回,它会立即提交。

The correct answer is that Oracle DDL uses an implicit transaction - there's no opportunity to the transaction back, it's immediately committed.

暮年慕年 2024-08-22 08:58:00

简而言之,“是”。 DDL 语句在执行后立即提交。如果您的脚本还包含 INSERT 语句来填充这些表,那么如果没有自己的提交,这些表将不会被保存。

In short, "yes". DDL statements are committed immediately after execution. If your script also includes INSERT statements to populate those tables, then those would not be saved without a commit of their own.

小矜持 2024-08-22 08:58:00

嗯,什么?是的,对数据和表结构的所有更改都会立即保存(除非事务的一部分,它会等到事务结束才能永久保存)
取决于您的会话的是会话变量和会话设置。

Umm, what? Yes all changes to Data and Table structures are immediately saved (unless part of a transaction, which waits till the end of the transaction to permanently save)
The things that are dependent upon your Session are session variables and session settings.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文