mysql - 更改已关闭(但未解除分配)CURSOR 的 SELECT

标签 mysql sql sql-server oracle cursor

我找到了这条语句here :

"After closing a cursor, a program can open it again, which implies that the DBMS re-evaluates the same query or a different query and builds a new result set."

你能在 SQL Server 中做到这一点吗?我在 Transact-SQL Cursor 页面上没有找到与此相关的任何内容。

其他 DBMS 是否支持这样的功能?

最佳答案

FWIW。对于 SQL 服务器。 https://learn.microsoft.com/en-us/sql/t-sql/language-elements/close-transact-sql

CLOSE leaves the data structures available for reopening, but fetches and positioned updates are not allowed until the cursor is reopened. CLOSE must be issued on an open cursor; CLOSE is not allowed on cursors that have only been declared or are already closed.

语法

CLOSE { { [ GLOBAL ] cursor_name } | cursor_variable_name }

参数

全局

指定 cursor_name 指的是全局游标。

cursor_name

是打开游标的名称。如果以 cursor_name 作为名称的全局游标和局部游标都存在,则在指定 GLOBAL 时 cursor_name 指的是全局游标;否则,cursor_name 指的是本地游标。

cursor_variable_name

是与打开的游标关联的游标变量的名称。

关于mysql - 更改已关闭(但未解除分配)CURSOR 的 SELECT,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46981611/

相关文章:

php - 使用 MySQL 限制每天发送的访问者

mysql - 如何使用Mysql查询从表中获取最大记录?

php - SQL 提交的正确语法

MYSQL IF NOT EXISTS/WHERE NOT EXISTS 错误

mysql - 插入数据库时​​表情符号替换为问号

sql-server - 如何获取本地计算机上所有 MS SQL Server 实例的列表?

php代码选择最大值并在表中显示最大值的计数

mysql - 用等效的 EXISTS() 查询替换 IN() 子查询

sql-server - 使用 If EXIST DROP 生成脚本,但不包括 SQL Server 中 CREATE 中的 If Not Exists

java - JDBC SQL Server 异常