![](https://csdnimg.cn/release/download_crawler_static/11891348/bg12.jpg)
34.4.4.2.2. interval ............................................................................ 822
34.4.4.2.3. numeric, decimal.............................................................823
34.4.4.3. Host Variables with Nonprimitive Types .................................... 824
34.4.4.3.1. Arrays .............................................................................824
34.4.4.3.2. Structures ........................................................................ 825
34.4.4.3.3. Typedefs..........................................................................826
34.4.4.3.4. Pointers ...........................................................................827
34.4.5. Handling Nonprimitive SQL Data Types.................................................827
34.4.5.1. Arrays..........................................................................................827
34.4.5.2. Composite Types .........................................................................829
34.4.5.3. User-defined Base Types .............................................................831
34.4.6. Indicators..................................................................................................832
34.5. Dynamic SQL.......................................................................................................832
34.5.1. Executing Statements without a Result Set ............................................. 832
34.5.2. Executing a Statement with Input Parameters ......................................... 833
34.5.3. Executing a Statement with a Result Set ................................................. 833
34.6. pgtypes Library.....................................................................................................834
34.6.1. Character Strings......................................................................................835
34.6.2. The numeric Type ....................................................................................835
34.6.3. The date Type........................................................................................... 837
34.6.4. The timestamp Type................................................................................. 841
34.6.5. The interval Type .....................................................................................844
34.6.6. The decimal Type..................................................................................... 845
34.6.7. errno Values of pgtypeslib .......................................................................845
34.6.8. Special Constants of pgtypeslib............................................................... 846
34.7. Using Descriptor Areas ........................................................................................847
34.7.1. Named SQL Descriptor Areas .................................................................847
34.7.2. SQLDA Descriptor Areas ........................................................................849
34.7.2.1. SQLDA Data Structure................................................................850
34.7.2.1.1. sqlda_t Structure ............................................................. 850
34.7.2.1.2. sqlvar_t Structure............................................................ 851
34.7.2.1.3. struct sqlname Structure .................................................851
34.7.2.2. Retrieving a Result Set Using an SQLDA ..................................852
34.7.2.3. Passing Query Parameters Using an SQLDA..............................853
34.7.2.4. A Sample Application Using SQLDA ........................................854
34.8. Error Handling...................................................................................................... 860
34.8.1. Setting Callbacks ..................................................................................... 860
34.8.2. sqlca ......................................................................................................... 862
34.8.3. SQLSTATE vs. SQLCODE........................................................................... 863
34.9. Preprocessor Directives ........................................................................................ 867
34.9.1. Including Files ......................................................................................... 867
34.9.2. The define and undef Directives .............................................................. 867
34.9.3. ifdef, ifndef, else, elif, and endif Directives.............................................868
34.10. Processing Embedded SQL Programs................................................................ 869
34.11. Library Functions ...............................................................................................870
34.12. Large Objects...................................................................................................... 870
34.13. C++ Applications ...............................................................................................872
34.13.1. Scope for Host Variables........................................................................872
34.13.2. C++ Application Development with External C Module ......................874
34.14. Embedded SQL Commands ...............................................................................876
ALLOCATE DESCRIPTOR ...............................................................................876
CONNECT...........................................................................................................878
xviii