Oracle 游标与 SQL Server 游标

发布于 2024-12-24 23:20:53 字数 405 浏览 3 评论 0原文

我是 Oracle 的新手,我想知道 Oracle 是否有像 SQLSERVER< 这样的游标选项/a>. 像这样的:

[ LOCAL |全球]
[仅转发|滚动]
[ 静电 |键盘|动态 |快进]
[ 只读 |滚动锁定 |乐观]
[ TYPE_WARNING ]
FOR select_statement
[ FOR UPDATE [ OF column_name [ ,...n ] ] ]

请发布一些链接,我可以在其中阅读如何使用它们或代码示例。

I am a newbie in Oracle and I was wondering if Oracle has options for cursors like SQLSERVER.
Like this ones:

[ LOCAL | GLOBAL ]
[ FORWARD_ONLY | SCROLL ]
[ STATIC | KEYSET | DYNAMIC | FAST_FORWARD ]
[ READ_ONLY | SCROLL_LOCKS | OPTIMISTIC ]
[ TYPE_WARNING ]
FOR select_statement
[ FOR UPDATE [ OF column_name [ ,...n ] ] ]

Please post some links where I could read on how to use them or code examples.

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

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

发布评论

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

评论(2

知足的幸福 2024-12-31 23:20:53

Oracle 中的显式游标没有与其关联的元数据。以下是翻译,将 Oracle 的行为放入 T-SQL 上下文中。

Oracle 游标不支持滚动。所以它们是 FORWARD_ONLY,没有讨论。这意味着 SCROLL、FAST_FORWARD、SCROLL_LOCKS 和 KEYSET 不适用。

所有 Oracle 游标都是 LOCAL。

由于 Oracle 的隔离级别,游标相当于 INSENSITIVE 和 STATIC。

除非我们使用 FOR UPDATE SQL 语法(该语法会锁定所选行),否则游标是 OPTIMISTIC。 了解更多信息

游标是 READ_ONLY。它们仅用于获取数据。我们可以使用 WHERE CURRENT OF 语法来更新游标标识的行。这最好与FOR UPDATE结合使用。 了解更多信息

您不会惊讶地发现 TYPE_WARNING 不适用(因为没有其他方法适用)。

Explicit cursors in Oracle don't have metadata associated with them. The following is a translation, putting Oracle's behaviour into a T-SQL context.

Oracle cursors do not support scrolling. So they are FORWARD_ONLY, no discussion. This means SCROLL, FAST_FORWARD, SCROLL_LOCKS and KEYSET do not apply.

All Oracle cursors are LOCAL.

Because of Oracle's isolation level, the cursors are the equivalent of INSENSITIVE and STATIC.

Cursors are OPTIMISTIC unless we use the FOR UPDATE SQL syntax, which locks the selected row(s). Find out more

Cursors are READ_ONLY. They are for fetching data only. We can use the WHERE CURRENT OF syntax to update a row identified by a cursor. This is best used in conjunction with FOR UPDATE. Find out more.

You won't be surprised to learn that TYPE_WARNING doesn't apply (because nothing else does).

往日情怀 2024-12-31 23:20:53

所有这些信息都可以在此处找到,特别是此处此处

All that info can be found HERE and specially HERE or HERE.

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