> 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-descriptors.md). Agents can also search and read this documentation through its [MCP server](https://docs.postgresql.tw/~gitbook/mcp).

# 34.7. 使用描述區 \#

### 34.7. 使用描述區 [#](#ecpg-descriptors) <a href="#ecpg-descriptors" id="ecpg-descriptors"></a>

[34.7.1. 具名 SQL 描述區](https://docs.postgresql.tw/19/client-interfaces/ecpg/ecpg-descriptors/ecpg-named-descriptors.md#ecpg-named-descriptors)

[34.7.2. SQLDA 描述區](https://docs.postgresql.tw/19/client-interfaces/ecpg/ecpg-descriptors/ecpg-sqlda-descriptors.md#ecpg-sqlda-descriptors)

SQL 描述區是處理 `SELECT`、`FETCH` 或 `DESCRIBE` 陳述式結果的一種較進階的方法。SQL 描述區會把一個資料列的資料連同中繼資料項目，一起歸入同一個資料結構中。執行動態 SQL 陳述式時，結果欄位的性質可能無法事先得知，因此中繼資料特別有用。PostgreSQL 提供兩種使用描述區的方式：具名 SQL 描述區，以及 C 結構形式的 SQLDA。

#### 34.7.1. 具名 SQL 描述區 [#](#ecpg-named-descriptors) <a href="#ecpg-named-descriptors" id="ecpg-named-descriptors"></a>

本節內容請參閱[34.7.1. 具名 SQL 描述區](https://docs.postgresql.tw/19/client-interfaces/ecpg/ecpg-descriptors/ecpg-named-descriptors.md#ecpg-named-descriptors)。

#### 34.7.2. SQLDA 描述區 [#](#ecpg-sqlda-descriptors) <a href="#ecpg-sqlda-descriptors" id="ecpg-sqlda-descriptors"></a>

本節內容請參閱[34.7.2. SQLDA 描述區](https://docs.postgresql.tw/19/client-interfaces/ecpg/ecpg-descriptors/ecpg-sqlda-descriptors.md#ecpg-sqlda-descriptors)。

#### 34.7.2.1. SQLDA 資料結構 [#](#ecpg-sqlda-descriptors-sqlda) <a href="#ecpg-sqlda-descriptors-sqlda" id="ecpg-sqlda-descriptors-sqlda"></a>

本節內容請參閱[34.7.2.1. SQLDA 資料結構](https://docs.postgresql.tw/19/client-interfaces/ecpg/ecpg-descriptors/ecpg-sqlda-descriptors/ecpg-sqlda-data-structures.md#ecpg-sqlda-descriptors-sqlda)。

<br>

***

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


---

# 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-descriptors.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.
