CLOSE 中文man頁面
NAME
CLOSE - 關閉一個游標
SYNOPSIS
CLOSE name
DESCRIPTION 描述
CLOSE 釋放和一個游標關聯的資源。 一個游標關閉后,不允許對其再做任何操作。一個不再使用的游標應該關閉掉。
在一個事務用 COMMIT 或者 ROLLBACK 終止之后, 每個不可保持的已打開游標都隱含關閉。如果創建事務通過 ROLLBACK 退出, 那么一個可以保持的游標隱含關閉。如果創建事務成功提交,那么可保持的游標保持打開, 直到執行一個明確的 CLOSE,或者客戶端斷開。
PARAMETERS 參數
- name
一個待關閉的游標的名字。
NOTES 注意
PostgreSQL 沒有明確的 OPEN (打開)游標的語句; 我們認為一個游標在聲明時就打開了。使用 DECLARE 語句聲明一個游標。
EXAMPLES 例子
關閉游標 liahona:
CLOSE liahona;
#p#
NAME
CLOSE - close a cursor
SYNOPSIS
CLOSE name
DESCRIPTION
CLOSE frees the resources associated with an open cursor. After the cursor is closed, no subsequent operations are allowed on it. A cursor should be closed when it is no longer needed.
Every non-holdable open cursor is implicitly closed when a transaction is terminated by COMMIT or ROLLBACK. A holdable cursor is implicitly closed if the transaction that created it aborts via ROLLBACK. If the creating transaction successfully commits, the holdable cursor remains open until an explicit CLOSE is executed, or the client disconnects.
PARAMETERS
- name
- The name of an open cursor to close.
NOTES
PostgreSQL does not have an explicit OPEN cursor statement; a cursor is considered open when it is declared. Use the DECLARE statement to declare a cursor.
EXAMPLES
Close the cursor liahona:
CLOSE liahona;