2 Chapter 34. ECPG — Embedded SQL in C
7 34.2. Managing Database Connections
9 34.2.1. Connecting to the Database Server
10 34.2.2. Choosing a Connection
11 34.2.3. Closing a Connection
13 34.3. Running SQL Commands
15 34.3.1. Executing SQL Statements
17 34.3.3. Managing Transactions
18 34.3.4. Prepared Statements
20 34.4. Using Host Variables
23 34.4.2. Declare Sections
24 34.4.3. Retrieving Query Results
26 34.4.5. Handling Nonprimitive SQL Data Types
31 34.5.1. Executing Statements without a Result Set
32 34.5.2. Executing a Statement with Input Parameters
33 34.5.3. Executing a Statement with a Result Set
37 34.6.1. Character Strings
38 34.6.2. The numeric Type
40 34.6.4. The timestamp Type
41 34.6.5. The interval Type
42 34.6.6. The decimal Type
43 34.6.7. errno Values of pgtypeslib
44 34.6.8. Special Constants of pgtypeslib
46 34.7. Using Descriptor Areas
48 34.7.1. Named SQL Descriptor Areas
49 34.7.2. SQLDA Descriptor Areas
53 34.8.1. Setting Callbacks
55 34.8.3. SQLSTATE vs. SQLCODE
57 34.9. Preprocessor Directives
59 34.9.1. Including Files
60 34.9.2. The define and undef Directives
61 34.9.3. ifdef, ifndef, elif, else, and endif Directives
63 34.10. Processing Embedded SQL Programs
64 34.11. Library Functions
66 34.13. C++ Applications
68 34.13.1. Scope for Host Variables
69 34.13.2. C++ Application Development with External C Module
71 34.14. Embedded SQL Commands
73 ALLOCATE DESCRIPTOR — allocate an SQL descriptor area
74 CONNECT — establish a database connection
75 DEALLOCATE DESCRIPTOR — deallocate an SQL descriptor area
76 DECLARE — define a cursor
77 DECLARE STATEMENT — declare SQL statement identifier
78 DESCRIBE — obtain information about a prepared statement or result
81 DISCONNECT — terminate a database connection
82 EXECUTE IMMEDIATE — dynamically prepare and execute a statement
83 GET DESCRIPTOR — get information from an SQL descriptor area
84 OPEN — open a dynamic cursor
85 PREPARE — prepare a statement for execution
86 SET AUTOCOMMIT — set the autocommit behavior of the current
89 SET CONNECTION — select a database connection
90 SET DESCRIPTOR — set information in an SQL descriptor area
91 TYPE — define a new data type
92 VAR — define a variable
93 WHENEVER — specify the action to be taken when an SQL statement
94 causes a specific class condition to be raised
96 34.15. Informix Compatibility Mode
98 34.15.1. Additional Types
99 34.15.2. Additional/Missing Embedded SQL Statements
100 34.15.3. Informix-compatible SQLDA Descriptor Areas
101 34.15.4. Additional Functions
102 34.15.5. Additional Constants
104 34.16. Oracle Compatibility Mode
107 This chapter describes the embedded SQL package for PostgreSQL. It was
108 written by Linus Tolke (<linus@epact.se>) and Michael Meskes
109 (<meskes@postgresql.org>). Originally it was written to work with C. It
110 also works with C++, but it does not recognize all C++ constructs yet.
112 This documentation is quite incomplete. But since this interface is
113 standardized, additional information can be found in many resources