# Chapter 36. ECPG — Embedded SQL in C
Table of Contents
36.2. Managing Database Connections
36.2.1. Connecting to the Database Server
36.3.1. Executing SQL Statements
36.4.3. Retrieving Query Results
36.4.5. Handling Nonprimitive SQL Data Types
36.5.1. Executing Statements without a Result Set
36.5.2. Executing a Statement with Input Parameters
36.5.3. Executing a Statement with a Result Set
36.6.7. errno Values of pgtypeslib
36.6.8. Special Constants of pgtypeslib
36.7.1. Named SQL Descriptor Areas
36.7.2. SQLDA Descriptor Areas
36.9.2. The define and undef Directives
36.9.3. ifdef, ifndef, elif, else, and endif Directives
36.10. Processing Embedded SQL Programs
36.13.1. Scope for Host Variables
36.13.2. C++ Application Development with External C Module
36.14. Embedded SQL CommandsALLOCATE DESCRIPTOR — allocate an SQL descriptor areaCONNECT — establish a database connectionDEALLOCATE DESCRIPTOR — deallocate an SQL descriptor areaDECLARE — define a cursorDECLARE STATEMENT — declare SQL statement identifierDESCRIBE — obtain information about a prepared statement or result setDISCONNECT — terminate a database connectionEXECUTE IMMEDIATE — dynamically prepare and execute a statementGET DESCRIPTOR — get information from an SQL descriptor areaOPEN — open a dynamic cursorPREPARE — prepare a statement for executionSET AUTOCOMMIT — set the autocommit behavior of the current sessionSET CONNECTION — select a database connectionSET DESCRIPTOR — set information in an SQL descriptor areaTYPE — define a new data typeVAR — define a variableWHENEVER — specify the action to be taken when an SQL statement causes a specific class condition to be raised36.15. Informix Compatibility Mode
36.15.2. Additional/Missing Embedded SQL Statements
36.15.3. Informix-compatible SQLDA Descriptor Areas
This chapter describes the embedded SQL package for PostgreSQL. It was written by Linus Tolke (<[linus@epact.se](mailto:linus@epact.se)>
) and Michael Meskes (<[meskes@postgresql.org](mailto:meskes@postgresql.org)>
). Originally it was written to work with C. It also works with C++, but it does not recognize all C++ constructs yet.
This documentation is quite incomplete. But since this interface is standardized, additional information can be found in many resources about SQL.