Numeric host variables in C and C++ applications that use SQL

The topic contains a figure showing the syntax for valid numeric host variable declarations.

Numeric

Read syntax diagramSkip visual syntax diagram
>>-+--------+--+----------+------------------------------------->
   +-auto---+  +-const----+   
   +-extern-+  '-volatile-'   
   '-static-'                 

>--+-float----------------------------------+------------------->
   +-double---------------------------------+   
   +-decimal (--precision--+----------+--)--+   
   |                       '-,--scale-'     |   
   |                              .-int-.   |   
   '-+-+--------+--+-long long-+--+-----+-+-'   
     | '-signed-'  +-long------+          |     
     |             '-short-----'          |     
     +-sqlint32---------------------------+     
     '-sqlint64---------------------------'     

   .-,----------------------------------.        
   V                                    |        
>----variable-name--+-----------------+-+-- ; -----------------><
                    '- = --expression-'          

Notes:
  1. Precision and scale must be integer constants. Precision may be in the range from 1 to 63. Scale may be in the range from 0 to the precision.
  2. If using the decimal data type, the header file decimal.h must be included.
  3. If using sqlint32 or sqlint64, the header file sqlsystm.h must be included.