5. Embedded QUEL for Ada : Ada Variables and Data Types : Data Type Conversion
 
Share this page                  
Data Type Conversion
An Ada variable declaration must be compatible with the Ingres value it represents. Numeric Ingres values can be set by and retrieved into numeric variables, and Ingres character values can be set by and retrieved into character string variables.
Data type conversion occurs automatically for different numeric types, such as from floating-point Ingres database column values into integer Ada variables, and for character strings, such as from varying-length Ingres character fields into fixed-length Ada character string buffers.
Ingres does not automatically convert between numeric and character types. You must use the Ingres type conversion operators, the Ingres ascii function, or an Ada conversion procedure for this purpose.
The following table shows the default type compatibility for each Ingres data type. Note that some Ada types do not match exactly and, consequently, may go through some runtime conversion.