![](https://csdnimg.cn/release/download_crawler_static/15846186/bg12.jpg)
34.4.4.3.3. Typedefs..........................................................................814
34.4.4.3.4. Pointers ...........................................................................815
34.4.5. Handling Nonprimitive SQL Data Types.................................................815
34.4.5.1. Arrays..........................................................................................815
34.4.5.2. Composite Types .........................................................................817
34.4.5.3. User-defined Base Types .............................................................818
34.4.6. Indicators..................................................................................................820
34.5. Dynamic SQL.......................................................................................................820
34.5.1. Executing Statements without a Result Set ............................................. 820
34.5.2. Executing a Statement with Input Parameters ......................................... 820
34.5.3. Executing a Statement with a Result Set ................................................. 821
34.6. pgtypes Library.....................................................................................................822
34.6.1. The numeric Type ....................................................................................822
34.6.2. The date Type........................................................................................... 825
34.6.3. The timestamp Type................................................................................. 828
34.6.4. The interval Type .....................................................................................832
34.6.5. The decimal Type..................................................................................... 832
34.6.6. errno Values of pgtypeslib .......................................................................833
34.6.7. Special Constants of pgtypeslib............................................................... 834
34.7. Using Descriptor Areas ........................................................................................834
34.7.1. Named SQL Descriptor Areas .................................................................834
34.7.2. SQLDA Descriptor Areas ........................................................................836
34.7.2.1. SQLDA Data Structure................................................................837
34.7.2.1.1. sqlda_t Structure ............................................................. 837
34.7.2.1.2. sqlvar_t Structure............................................................ 838
34.7.2.1.3. struct sqlname Structure .................................................839
34.7.2.2. Retrieving a Result Set Using an SQLDA ..................................839
34.7.2.3. Passing Query Parameters Using an SQLDA..............................841
34.7.2.4. A Sample Application Using SQLDA ........................................842
34.8. Error Handling...................................................................................................... 847
34.8.1. Setting Callbacks ..................................................................................... 847
34.8.2. sqlca ......................................................................................................... 849
34.8.3. SQLSTATE vs. SQLCODE........................................................................... 851
34.9. Preprocessor Directives ........................................................................................ 854
34.9.1. Including Files ......................................................................................... 854
34.9.2. The define and undef Directives .............................................................. 855
34.9.3. ifdef, ifndef, else, elif, and endif Directives.............................................855
34.10. Processing Embedded SQL Programs................................................................ 856
34.11. Library Functions ...............................................................................................857
34.12. Large Objects...................................................................................................... 858
34.13. C++ Applications ...............................................................................................859
34.13.1. Scope for Host Variables........................................................................860
34.13.2. C++ Application Development with External C Module ......................861
34.14. Embedded SQL Commands ...............................................................................863
ALLOCATE DESCRIPTOR ...............................................................................863
CONNECT...........................................................................................................865
DEALLOCATE DESCRIPTOR .......................................................................... 868
DECLARE ...........................................................................................................869
DESCRIBE ..........................................................................................................871
DISCONNECT ....................................................................................................872
EXECUTE IMMEDIATE....................................................................................874
GET DESCRIPTOR ............................................................................................ 875
xviii