我找到了这条语句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/