Declaration of numeric host variables in C and C++ embedded SQL applications
Numeric host variables
that you declare in your embedded C or C++ application are treated
as if they were declared in a C or C++ program. You can use host variables
to exchange data between the embedded application and the database
manager.
Following is the syntax for declaring numeric host variables in C or C++.
Notes:
- 1 REAL (SQLTYPE 480), length 4
- 2 DOUBLE (SQLTYPE 480), length 8
- 3 SMALLINT (SQLTYPE 500)
- 4 For maximum application portability, use
sqlint32for INTEGER host variables andsqlint64for BIGINT host variables. By default, the use of long host variables results in the precompiler error SQL0402 on platforms where long is a 64 bit quantity, such as 64 BIT UNIX. Use the PREP option LONGERROR NO to force Db2® to accept long variables as acceptable host variable types and treat them as BIGINT variables. - 5 For maximum application portability, use
sqlint32andsqlint64for INTEGER and BIGINT host variables. To use the BIGINT data type, your platform must support 64 bit integer values. By default, the use of long host variables results in the precompiler error SQL0402 on platforms where long is a 64 bit quantity, such as 64 BIT UNIX. Use the PREP option LONGERROR NO to force Db2 to accept long variables as acceptable host variable types and treat them as BIGINT variables.
