Chapter 34. ECPG — Embedded SQL in C

Table of Contents

34.1. The Concept
34.2. Managing Database Connections
34.2.1. Connecting to the Database Server
34.2.2. Choosing a Connection
34.2.3. Closing a Connection
34.3. Running SQL Commands
34.3.1. Executing SQL Statements
34.3.2. Using Cursors
34.3.3. Managing Transactions
34.3.4. Prepared Statements
34.4. Using Host Variables
34.4.1. Overview
34.4.2. Declare Sections
34.4.3. Retrieving Query Results
34.4.4. Type Mapping
34.4.5. Handling Nonprimitive SQL Data Types
34.4.6. Indicators
34.5. Dynamic SQL
34.5.1. Executing Statements without a Result Set
34.5.2. Executing a Statement with Input Parameters
34.5.3. Executing a Statement with a Result Set
34.6. pgtypes Library
34.6.1. Character Strings
34.6.2. The numeric Type
34.6.3. The date Type
34.6.4. The timestamp Type
34.6.5. The interval Type
34.6.6. The decimal Type
34.6.7. errno Values of pgtypeslib
34.6.8. Special Constants of pgtypeslib
34.7. Using Descriptor Areas
34.7.1. Named SQL Descriptor Areas
34.7.2. SQLDA Descriptor Areas
34.8. Error Handling
34.8.1. Setting Callbacks
34.8.2. sqlca
34.8.3. SQLSTATE vs. SQLCODE
34.9. Preprocessor Directives
34.9.1. Including Files
34.9.2. The define and undef Directives
34.9.3. ifdef, ifndef, elif, else, and endif Directives
34.10. Processing Embedded SQL Programs
34.11. Library Functions
34.12. Large Objects
34.13. C++ Applications
34.13.1. Scope for Host Variables
34.13.2. C++ Application Development with External C Module
34.14. Embedded SQL Commands
34.15. Informix™ Compatibility Mode
34.15.1. Additional Types
34.15.2. Additional/Missing Embedded SQL Statements
34.15.3. Informix-compatible SQLDA Descriptor Areas
34.15.4. Additional Functions
34.15.5. Additional Constants
34.16. Oracle™ Compatibility Mode
34.17. Internals

This chapter describes the embedded SQL package for PostgreSQL™. It was written by Linus Tolke () and Michael Meskes (). 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.