6. Embedded SQL for BASIC : BASIC Variables and Data Types : Data Type Conversion
 
Share this page                  
Data Type Conversion
A BASIC 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 string variables.
Data type conversion occurs automatically for different numeric types, as follows:
From floating-point Ingres database column values into integer BASIC variables
From integer to decimal
From decimal to integer
For different length character strings, such as from varying-length Ingres character fields, into static BASIC string variables
Ingres does not automatically convert between numeric and character types. You must use the Ingres type conversion functions, the Ingres ascii function, or a BASIC conversion procedure for this purpose.