> 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/15/client-interfaces/ecpg-embedded-sql-in-c/35.14.-embedded-sql-commands.md).

# 36.14. Embedded SQL Commands

## 36.14. Embedded SQL Commands

[ALLOCATE DESCRIPTOR](/15/client-interfaces/ecpg-embedded-sql-in-c/35.14.-embedded-sql-commands/ecpg-sql-allocate-descriptor.md) — allocate an SQL descriptor area

[CONNECT](/15/client-interfaces/ecpg-embedded-sql-in-c/35.14.-embedded-sql-commands/ecpg-sql-connect.md) — establish a database connection

[DEALLOCATE DESCRIPTOR](/15/client-interfaces/ecpg-embedded-sql-in-c/35.14.-embedded-sql-commands/ecpg-sql-deallocate-descriptor.md) — deallocate an SQL descriptor area

[DECLARE](/15/client-interfaces/ecpg-embedded-sql-in-c/35.14.-embedded-sql-commands/ecpg-sql-declare.md) — define a cursor

[DECLARE STATEMENT](/15/client-interfaces/ecpg-embedded-sql-in-c/35.14.-embedded-sql-commands/ecpg-sql-declare-statement.md) — declare SQL statement identifier

[DESCRIBE](/15/client-interfaces/ecpg-embedded-sql-in-c/35.14.-embedded-sql-commands/ecpg-sql-describe.md) — obtain information about a prepared statement or result set

[DISCONNECT](/15/client-interfaces/ecpg-embedded-sql-in-c/35.14.-embedded-sql-commands/ecpg-sql-disconnect.md) — terminate a database connection

[EXECUTE IMMEDIATE](/15/client-interfaces/ecpg-embedded-sql-in-c/35.14.-embedded-sql-commands/ecpg-sql-execute-immediate.md) — dynamically prepare and execute a statement

[GET DESCRIPTOR](/15/client-interfaces/ecpg-embedded-sql-in-c/35.14.-embedded-sql-commands/ecpg-sql-get-descriptor.md) — get information from an SQL descriptor area

[OPEN](/15/client-interfaces/ecpg-embedded-sql-in-c/35.14.-embedded-sql-commands/ecpg-sql-open.md) — open a dynamic cursor

[PREPARE](/15/client-interfaces/ecpg-embedded-sql-in-c/35.14.-embedded-sql-commands/ecpg-sql-prepare.md) — prepare a statement for execution

[SET AUTOCOMMIT](/15/client-interfaces/ecpg-embedded-sql-in-c/35.14.-embedded-sql-commands/ecpg-sql-set-autocommit.md) — set the autocommit behavior of the current session

[SET CONNECTION](/15/client-interfaces/ecpg-embedded-sql-in-c/35.14.-embedded-sql-commands/ecpg-sql-set-connection.md) — select a database connection

[SET DESCRIPTOR](/15/client-interfaces/ecpg-embedded-sql-in-c/35.14.-embedded-sql-commands/ecpg-sql-set-descriptor.md) — set information in an SQL descriptor area

[TYPE](/15/client-interfaces/ecpg-embedded-sql-in-c/35.14.-embedded-sql-commands/ecpg-sql-type.md) — define a new data type

[VAR](/15/client-interfaces/ecpg-embedded-sql-in-c/35.14.-embedded-sql-commands/ecpg-sql-var.md) — define a variable

[WHENEVER](/15/client-interfaces/ecpg-embedded-sql-in-c/35.14.-embedded-sql-commands/ecpg-sql-whenever.md) — specify the action to be taken when an SQL statement causes a specific class condition to be raised

This section describes all SQL commands that are specific to embedded SQL. Also refer to the SQL commands listed in [SQL Commands](/15/reference/sql-commands.md), which can also be used in embedded SQL, unless stated otherwise.

***

原文：[PostgreSQL 15.19 Documentation](/15/client-interfaces/ecpg-embedded-sql-in-c/35.14.-embedded-sql-commands.md)（英文原文，待翻譯）


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.postgresql.tw/15/client-interfaces/ecpg-embedded-sql-in-c/35.14.-embedded-sql-commands.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
