> For the complete documentation index, see [llms.txt](https://docs.postgresql.tw/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.postgresql.tw/19/client-interfaces/ecpg/ecpg-informix-compat/ecpg-informix-statements.md). Agents can also search and read this documentation through its [MCP server](https://docs.postgresql.tw/~gitbook/mcp).

# 34.15.2. 額外／缺少的嵌入式 SQL 陳述式

### 34.15.2. 額外／缺少的嵌入式 SQL 陳述式 [#](#ecpg-informix-statements) <a href="#ecpg-informix-statements" id="ecpg-informix-statements"></a>

#### `CLOSE DATABASE` [#](#ecpg-informix-statements-close-database) <a href="#ecpg-informix-statements-close-database" id="ecpg-informix-statements-close-database"></a>

此陳述式會關閉目前的連線。事實上，它是 ECPG 的 `DISCONNECT CURRENT` 的同義詞：

```

    $CLOSE DATABASE;                /* close the current connection */
    EXEC SQL CLOSE DATABASE;
```

#### `FREE cursor_name` [#](#ecpg-informix-statements-free-cursor-name) <a href="#ecpg-informix-statements-free-cursor-name" id="ecpg-informix-statements-free-cursor-name"></a>

由於 ECPG 的運作方式與 Informix 的 ESQL/C 不同（也就是哪些步驟純屬語法轉換、哪些步驟仰賴底層的執行時期函式庫），ECPG 中沒有 `FREE cursor_name` 陳述式。這是因為在 ECPG 中，`DECLARE CURSOR` 並不會轉換成對執行時期函式庫、使用該游標名稱的函式呼叫。這表示 ECPG 執行時期函式庫中並不會在執行時期記錄 SQL 游標，只有 PostgreSQL 伺服器會記錄。

#### `FREE statement_name` [#](#ecpg-informix-statements-free-statement-name) <a href="#ecpg-informix-statements-free-statement-name" id="ecpg-informix-statements-free-statement-name"></a>

`FREE statement_name` 是 `DEALLOCATE PREPARE statement_name` 的同義詞。

[返回 34.15. Informix 相容模式](https://docs.postgresql.tw/19/client-interfaces/ecpg/ecpg-informix-compat.md#ecpg-informix-compat)。

***

原文：[PostgreSQL 18.6 Documentation](https://www.postgresql.org/docs/18/ecpg-informix-compat.html)（原文版本：18.6；核對日期：2026-10-22）


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.postgresql.tw/19/client-interfaces/ecpg/ecpg-informix-compat/ecpg-informix-statements.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
