CLOSE 中文man頁(yè)面
NAME
CLOSE - 關(guān)閉一個(gè)游標(biāo)
SYNOPSIS
CLOSE name
DESCRIPTION 描述
CLOSE 釋放和一個(gè)游標(biāo)關(guān)聯(lián)的資源。 一個(gè)游標(biāo)關(guān)閉后,不允許對(duì)其再做任何操作。一個(gè)不再使用的游標(biāo)應(yīng)該關(guān)閉掉。
在一個(gè)事務(wù)用 COMMIT 或者 ROLLBACK 終止之后, 每個(gè)不可保持的已打開游標(biāo)都隱含關(guān)閉。如果創(chuàng)建事務(wù)通過(guò) ROLLBACK 退出, 那么一個(gè)可以保持的游標(biāo)隱含關(guān)閉。如果創(chuàng)建事務(wù)成功提交,那么可保持的游標(biāo)保持打開, 直到執(zhí)行一個(gè)明確的 CLOSE,或者客戶端斷開。
PARAMETERS 參數(shù)
- name
一個(gè)待關(guān)閉的游標(biāo)的名字。
NOTES 注意
PostgreSQL 沒(méi)有明確的 OPEN (打開)游標(biāo)的語(yǔ)句; 我們認(rèn)為一個(gè)游標(biāo)在聲明時(shí)就打開了。使用 DECLARE 語(yǔ)句聲明一個(gè)游標(biāo)。
EXAMPLES 例子
關(guān)閉游標(biāo) 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;